Files
dsh-market/tsconfig.tests.json
fkysly 662d6e99ef fix(e2e): resolve the repo root as a path, not a URL pathname
First Windows run of the layer-3 lane failed before a single spec ran:

    Error: spawnSync C:\Windows\system32\cmd.exe ENOENT

cmd.exe was not missing. Node reports an invalid CWD as ENOENT against the
executable it never got to launch, and the cwd came from

    resolve(new URL('../..', import.meta.url).pathname)

On Windows that pathname keeps a leading slash — `/D:/a/repo` — and
resolving it yields a directory that does not exist. fileURLToPath is the
conversion that handles the drive letter. The same line had been copied into
the fixture registry, so both are fixed.

Why it reached CI at all: tsconfig excludes `tests`, so nothing typechecked
the scaffold, and the first version of this fix — which dropped the
fileURLToPath import while adding its call — was still green locally, since
a missing import is a runtime error and the file only runs when the e2e lane
does. tsconfig.tests.json now covers tests/web and runs as part of
`npm run typecheck`; removing that import again fails the gate immediately.

Process handling had to change too, or the lane could not have run on
Windows at all:

- teardown used `process.kill(-pid)`, a process GROUP call Windows does not
  have. It throws, the fallback kills only the shell wrapper, and the real
  dsh keeps holding the port — a hung job rather than a failed one. Windows
  goes through `taskkill /T` instead.
- `detached: true` maps to DETACHED_PROCESS there: no console at all, the
  very thing #40 had to undo, and pointless now that the kill no longer
  needs a group. POSIX-only.

Full test typechecking is a bigger job — mixing the server and client test
configs surfaces 300+ errors that are config mismatch, not defects — so this
covers the scaffold only, which is where the failure actually was.
2026-08-17 23:44:12 +08:00

12 lines
491 B
JSON

{
// The layer-3 scaffold is plain Node code that the main config does not
// cover (it excludes `tests`), so a missing import there fails only at
// runtime — and only on the platform that happens to hit that line. A
// dropped `fileURLToPath` import shipped exactly that way: green locally,
// ENOENT on Windows CI.
"extends": "./tsconfig.json",
"compilerOptions": { "noEmit": true, "rootDir": "." },
"include": ["tests/web", "src"],
"exclude": ["lib", "src/client"]
}