From 1ce2982274382c30162743ca609333b3d8812b2d Mon Sep 17 00:00:00 2001 From: Fluory Date: Sun, 27 Sep 2026 23:46:24 +0200 Subject: [PATCH 1/2] fix(tests): start dependency-cruiser through node so the architecture test runs on Windows The test spawned node_modules/.bin/depcruise, a POSIX shell shim that Windows cannot spawn without a shell (status null, ENOENT), so six architecture tests failed on every Windows machine and `pnpm verify` could never be green there. Node now runs the package's own entry (bin/dependency-cruiser.mjs) - same rules, no shell. Fixes #78 Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/architecture/dependency-rules.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/architecture/dependency-rules.test.ts b/tests/architecture/dependency-rules.test.ts index cb0a494..22d76b2 100644 --- a/tests/architecture/dependency-rules.test.ts +++ b/tests/architecture/dependency-rules.test.ts @@ -4,12 +4,14 @@ import { describe, expect, it } from "vitest"; const root = fileURLToPath(new URL("../..", import.meta.url)); const fixture = fileURLToPath(new URL("../fixtures/depcruise", import.meta.url)); -const bin = `${root}node_modules/.bin/depcruise`; +// Node runs the package's own entry: `node_modules/.bin/depcruise` is a POSIX shell shim that Windows +// cannot spawn without a shell (ENOENT, #78). +const bin = `${root}node_modules/dependency-cruiser/bin/dependency-cruiser.mjs`; // Runs the real dependency-cruiser with the project's config against a fixture tree that // contains one deliberate deep import across modules. function cruise(entry: string) { - const result = spawnSync(bin, [entry, "--config", `${root}.dependency-cruiser.cjs`, "--no-progress", "--output-type", "err"], { + const result = spawnSync(process.execPath, [bin, entry, "--config", `${root}.dependency-cruiser.cjs`, "--no-progress", "--output-type", "err"], { cwd: fixture, encoding: "utf8", }); From 9c893d4a6884a0b106b2908ecd0f4d2aa73de2da Mon Sep 17 00:00:00 2001 From: Fluory Date: Sun, 27 Sep 2026 23:57:33 +0200 Subject: [PATCH 2/2] test(architecture): give the dependency-cruiser cases room on Windows The fresh review of #87 measured 2.0-4.7 s per dependency-cruiser run on Windows against Vitest's 5 s default, and one isolated run timed out at 6.1 s. The block now has a 20 s limit; no assertion changes. Refs #78 Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/architecture/dependency-rules.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/architecture/dependency-rules.test.ts b/tests/architecture/dependency-rules.test.ts index 22d76b2..3a36fa3 100644 --- a/tests/architecture/dependency-rules.test.ts +++ b/tests/architecture/dependency-rules.test.ts @@ -18,7 +18,8 @@ function cruise(entry: string) { return { status: result.status, output: `${result.stdout}${result.stderr}` }; } -describe("module boundary rules", () => { +// Each case starts a real dependency-cruiser run: up to ~5 s on Windows (#87 review), ~1 s on Linux CI. +describe("module boundary rules", { timeout: 20_000 }, () => { it("rejects a deep import into another module's internals", () => { const { status, output } = cruise("src/features/alpha");