fix(test): a real home is never "the test HOME" to the deletion guards

safeRmHomeTree and isUnderTestHome answered "is this path under process.env.HOME?".
With test/setup.ts skipped (a bare vitest) HOME is the developer's real home, so every
real file passed, which is how the real linked-cases registry was deleted on 2026-10-10.

They now also require HOME to be the throwaway codeman-vitest-* directory setup.ts
creates, and the shared route harness throws when it is not, so every route test refuses
to start against a real ~/.codeman rather than just the one file that checked.
This commit is contained in:
Devvyn committed 2026-10-17 05:07:38 +08:00
1 parent 1802bafc74
commit 710ed73585
5 files changed
+149 -28

No files matched your search

+9 -1
View File
@@ -7,5 +7,13 @@
export { MockSession, createMockSession, terminalOutputs } from './mock-session.js';
export { MockStateStore } from './mock-state-store.js';
export { waitForEvent, createDeferred, safeRmHomeTree, isUnderTestHome } from './test-helpers.js';
export {
waitForEvent,
createDeferred,
safeRmHomeTree,
isUnderTestHome,
isSandboxedHome,
assertSandboxedHome,
TEST_HOME_PREFIX,
} from './test-helpers.js';
export { createMockRouteContext, type MockRouteContext } from './mock-route-context.js';