mirror of
https://github.com/morluto/rea.git
synced 2026-11-24 13:18:39 +00:00
* refactor(config): propagate typed configuration failures * refactor(lifecycle): centralize completion and cancellation * fix(config): preserve Hermes YAML edit refusal guidance
11 lines
369 B
TypeScript
11 lines
369 B
TypeScript
import type { Result } from "../../src/domain/result.js";
|
|
|
|
/** Unwrap successful fixture operations while preserving the cause of a failed test. */
|
|
export const expectResultValue = <Value, Failure>(
|
|
result: Result<Value, Failure>,
|
|
): Value => {
|
|
if (!result.ok)
|
|
throw new Error("Expected a successful result", { cause: result.error });
|
|
return result.value;
|
|
};
|