Symptom
On a fresh clone (or any checkout that has never run npm run build), npx vitest run app/electron/cli.test.ts fails 2 tests:
- resolveCodeburnPath (Vite development) > prefers the executable repo dist/cli.js when the Vite dev server is set
- resolveCodeburnPath (Vite development) > prefers the repo dev CLI over a persisted-path file (stale global) in dev
TypeError: .toMatch() expects to receive a string, but got object
app/electron/cli.test.ts:47:35
expect(resolveCodeburnPath()).toMatch(/dist\/cli\.js$/)
CI stays green because the pipeline builds before testing, so this only bites contributors running the suite locally. Reproduced on a clean checkout of main at 5869cad on 2026-07-16, and confirmed absent when dist/cli.js exists.
Root cause
The Vite-development branch of resolveCodeburnPath() only returns the repo CLI path when dist/cli.js actually exists and is executable. Without a prior build it falls through and the function returns a non-string shape, so the assertion gets an object.
Suggested fix
Have the two dev-resolution tests create the fixture they depend on: write a stub executable dist/cli.js into the temp repo root the test already controls (or chmod-touch one in a tmpdir and point resolution at it), rather than depending on the developer having built the real bundle. Skipping when the file is absent would also work but hides real resolution regressions, so a stub fixture is preferred.
Introduced in 916aa64 (Electron security + spawn efficiency batch, 2026-07-16).
Symptom
On a fresh clone (or any checkout that has never run
npm run build),npx vitest run app/electron/cli.test.tsfails 2 tests:CI stays green because the pipeline builds before testing, so this only bites contributors running the suite locally. Reproduced on a clean checkout of main at 5869cad on 2026-07-16, and confirmed absent when dist/cli.js exists.
Root cause
The Vite-development branch of
resolveCodeburnPath()only returns the repo CLI path whendist/cli.jsactually exists and is executable. Without a prior build it falls through and the function returns a non-string shape, so the assertion gets an object.Suggested fix
Have the two dev-resolution tests create the fixture they depend on: write a stub executable
dist/cli.jsinto the temp repo root the test already controls (or chmod-touch one in a tmpdir and point resolution at it), rather than depending on the developer having built the real bundle. Skipping when the file is absent would also work but hides real resolution regressions, so a stub fixture is preferred.Introduced in 916aa64 (Electron security + spawn efficiency batch, 2026-07-16).