refactor(test): keep coverage at behavioral boundaries (#474)
* refactor(test): keep coverage at behavioral boundaries * fix(ci): restore package workflow temp-root classification
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { logCliCommand } from "../../src/cliLogging.js";
|
||||
import { silentLogger } from "../../src/logger.js";
|
||||
|
||||
const originalExitCode = process.exitCode;
|
||||
|
||||
afterEach(() => {
|
||||
process.exitCode = originalExitCode;
|
||||
});
|
||||
|
||||
describe("CLI operation status", () => {
|
||||
it("sets a nonzero process status without replacing structured output", async () => {
|
||||
const output = {
|
||||
error: "Analysis failed",
|
||||
category: "integrity_mismatch",
|
||||
message: "Artifact integrity check failed.",
|
||||
details: { logical_path: "main.js" },
|
||||
};
|
||||
|
||||
await expect(
|
||||
logCliCommand(silentLogger, "inventory-artifact", () =>
|
||||
Promise.resolve(output),
|
||||
),
|
||||
).resolves.toBe(output);
|
||||
expect(process.exitCode).toBe(1);
|
||||
});
|
||||
});
|
||||
@@ -53,7 +53,11 @@ describe("Vitest project configuration", () => {
|
||||
expect(TEST_PROJECTS.map(({ name }) => name).sort()).toEqual(
|
||||
EXPECTED_PROJECTS,
|
||||
);
|
||||
const sharedModuleProjects = new Set(["domain", "services"]);
|
||||
const sharedModuleProjects = new Set([
|
||||
"domain",
|
||||
"mcp-boundary",
|
||||
"services",
|
||||
]);
|
||||
expect(
|
||||
TEST_PROJECTS.every(({ name, isolate }) =>
|
||||
sharedModuleProjects.has(name)
|
||||
|
||||
Reference in New Issue
Block a user