mirror of
https://github.com/morluto/rea
synced 2026-10-25 22:08:11 -04:00
16 lines
604 B
TypeScript
16 lines
604 B
TypeScript
import assert from "node:assert/strict";
|
|
import type { parseBinaryTarget } from "../../src/application/BinaryTargetResolver.js";
|
|
import { BinaryTargetError } from "../../src/domain/configurationErrors.js";
|
|
|
|
/** Require target admission failure rather than an unrelated cancellation. */
|
|
export const expectBinaryTargetError = (
|
|
result: Awaited<ReturnType<typeof parseBinaryTarget>>,
|
|
): BinaryTargetError => {
|
|
assert.ok(!result.ok, "Expected target admission to fail");
|
|
assert.ok(
|
|
result.error instanceof BinaryTargetError,
|
|
"Expected a target admission error",
|
|
);
|
|
return result.error;
|
|
};
|