fix: remove leaky mock.module() for project-name that polluted parallel workers (#1299)

Top-level mock.module() in context-reinjection-guard.test.ts permanently stubbed
getProjectName() to 'test-project' for the entire Bun worker process, causing
tests in other files to receive the wrong value. Removed the unnecessary mock
(session-init tests don't assert on project name), added bunfig.toml smol=true
for worker isolation, and added a regression test.

Generated by Claude Code
Vibe coded by ousamabenyounes

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ousama Ben Younes
2026-04-09 22:55:54 +00:00
parent 3651a34e96
commit 5676cab83f
3 changed files with 35 additions and 4 deletions
@@ -29,10 +29,6 @@ mock.module('../../src/shared/worker-utils.js', () => ({
getWorkerPort: () => 37777,
}));
mock.module('../../src/utils/project-name.js', () => ({
getProjectName: () => 'test-project',
}));
mock.module('../../src/utils/project-filter.js', () => ({
isProjectExcluded: () => false,
}));