From 8cbaf6c7021b97dd4de6b5771c35fbed06b240e9 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sun, 18 Oct 2026 12:42:26 +0800 Subject: [PATCH] fix(tests): isolate command finalization module mocks Move the five registered WASM finalization cases into the existing per-file isolated project. Preserve all result, exit-code, observation and cleanup assertions. A preloaded shared CLI graph reproduces three failures before the move; the isolated covered packet passes. Fixes #4959 --- .../commandFinalizationCancellation.test.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename tests/{boundary/cli => process-global}/commandFinalizationCancellation.test.ts (83%) diff --git a/tests/boundary/cli/commandFinalizationCancellation.test.ts b/tests/process-global/commandFinalizationCancellation.test.ts similarity index 83% rename from tests/boundary/cli/commandFinalizationCancellation.test.ts rename to tests/process-global/commandFinalizationCancellation.test.ts index 88454632d..3839c5733 100644 --- a/tests/boundary/cli/commandFinalizationCancellation.test.ts +++ b/tests/process-global/commandFinalizationCancellation.test.ts @@ -1,17 +1,17 @@ import { Cli } from "incur"; import { afterEach, expect, it, vi } from "vitest"; -import { WasmArtifactService } from "../../../src/application/wasm/WasmArtifactService.js"; -import { registerWasmCommands } from "../../../src/cli/wasmCommands.js"; -import { wasmArtifactModule } from "../../../src/composition/wasm.js"; -import { AnalysisOutputError } from "../../../src/domain/analysisErrorCore.js"; -import { ProviderCleanupError } from "../../../src/domain/providerCleanupError.js"; -import { err, ok } from "../../../src/domain/result.js"; -import { silentLogger } from "../../../src/logger.js"; +import { WasmArtifactService } from "../../src/application/wasm/WasmArtifactService.js"; +import { registerWasmCommands } from "../../src/cli/wasmCommands.js"; +import { wasmArtifactModule } from "../../src/composition/wasm.js"; +import { AnalysisOutputError } from "../../src/domain/analysisErrorCore.js"; +import { ProviderCleanupError } from "../../src/domain/providerCleanupError.js"; +import { err, ok } from "../../src/domain/result.js"; +import { silentLogger } from "../../src/logger.js"; import { wasmArtifactExecution, wasmArtifactFixture, -} from "../../fixtures/wasm/artifact.js"; +} from "../fixtures/wasm/artifact.js"; const host = vi.hoisted(() => ({ listeners: new Map void>(), @@ -24,10 +24,10 @@ const host = vi.hoisted(() => ({ }, })); -vi.mock("../../../src/cli/commandCancellation.js", async (importOriginal) => { +vi.mock("../../src/cli/commandCancellation.js", async (importOriginal) => { const original = await importOriginal< - typeof import("../../../src/cli/commandCancellation.js") + typeof import("../../src/cli/commandCancellation.js") >(); return { ...original,