mirror of
https://github.com/morluto/rea
synced 2026-10-25 22:08:11 -04:00
test(setup): align boundary assertions with owned contracts
This commit is contained in:
@@ -96,7 +96,7 @@ const cases = [
|
||||
client: "dsh",
|
||||
path: ".dsh/cordis.patch.yml",
|
||||
text: "- insert: [\n",
|
||||
diagnostic: "Configuration is not valid YAML",
|
||||
diagnostic: "Invalid or unsupported Cordis YAML",
|
||||
syntax: "YAML",
|
||||
},
|
||||
] as const;
|
||||
|
||||
@@ -754,13 +754,10 @@ for (const invalidSetting of [
|
||||
});
|
||||
expect(result.exitCode).toBe(1);
|
||||
expect(result.json).toMatchObject({
|
||||
code: "configuration_invalid",
|
||||
category: "invalid_input",
|
||||
details: {
|
||||
settings: [
|
||||
expect.objectContaining({ setting: invalidSetting.setting }),
|
||||
],
|
||||
},
|
||||
status: "needs_human",
|
||||
plannedActions: [],
|
||||
appliedActions: [],
|
||||
remediation: expect.stringContaining(invalidSetting.setting),
|
||||
});
|
||||
expect(`${result.stdout}\n${result.stderr}`).toContain(
|
||||
invalidSetting.setting,
|
||||
|
||||
@@ -4,7 +4,10 @@ import { join } from "node:path";
|
||||
import { describe, expect } from "vitest";
|
||||
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
import { analysisCliErrorEnvelopeSchema } from "../../../src/contracts/errorSchemas.js";
|
||||
import {
|
||||
analysisCliErrorEnvelopeSchema,
|
||||
analysisErrorProjectionSchema,
|
||||
} from "../../../src/contracts/errorSchemas.js";
|
||||
import { cliTest } from "../../support/cli/cliFixture.js";
|
||||
|
||||
const unsupportedHostOutput = expect.objectContaining({
|
||||
@@ -49,7 +52,13 @@ describe("compiled Windows reference-source import", () => {
|
||||
scenario.fullOutput
|
||||
? expect.objectContaining({
|
||||
ok: false,
|
||||
error: unsupportedHostOutput,
|
||||
error: expect.objectContaining({
|
||||
code: "capability_unavailable",
|
||||
category: "unsupported_provider",
|
||||
message: expect.stringContaining(
|
||||
"Safe no-follow file opens are unavailable on this host.",
|
||||
),
|
||||
}),
|
||||
})
|
||||
: unsupportedHostOutput,
|
||||
);
|
||||
@@ -109,7 +118,6 @@ describe("compiled reference-source import preflight failures", () => {
|
||||
? "Reference source root could not be resolved"
|
||||
: "Reference source root is not a directory";
|
||||
const invalidRootOutput = {
|
||||
error: "Import failed",
|
||||
category: "invalid_input",
|
||||
message: expect.stringContaining(rootReason),
|
||||
};
|
||||
@@ -119,13 +127,19 @@ describe("compiled reference-source import preflight failures", () => {
|
||||
error: invalidRootOutput,
|
||||
});
|
||||
} else {
|
||||
expect(result.json).toMatchObject(invalidRootOutput);
|
||||
expect(result.json).toMatchObject({
|
||||
...invalidRootOutput,
|
||||
error: "Import failed",
|
||||
});
|
||||
}
|
||||
const projection = scenario.fullOutput
|
||||
? (result.json as { error: unknown }).error
|
||||
: result.json;
|
||||
expect(
|
||||
analysisCliErrorEnvelopeSchema.safeParse(projection).success,
|
||||
(scenario.fullOutput
|
||||
? analysisErrorProjectionSchema
|
||||
: analysisCliErrorEnvelopeSchema
|
||||
).safeParse(projection).success,
|
||||
).toBe(true);
|
||||
const messagePath = scenario.fullOutput ? "error.message" : "message";
|
||||
expect(result.json).toHaveProperty(
|
||||
|
||||
Reference in New Issue
Block a user