Commit 825de75
committed
[Task 5] Fix shell integration test isolation
Fix mock pollution in shell integration tests by using cache-busting dynamic imports.
Issue: Agent unit tests use mock.module() which creates persistent module mocks. Even after mock.restore(), Bun's module cache still serves the mocked version to subsequent imports.
Solution:
- Dynamically import shell module in beforeAll hook after calling mock.restore()
- Add timestamp query parameter to force fresh import and bypass module cache
- Rename test file to zzz-shell.integration.test.ts for consistent ordering
Result: All 14 failing tests now pass
- Before: 568 pass, 14 fail
- After: 582 pass, 0 fail
Tests verified: bun test completes successfully1 parent dc8a616 commit 825de75
1 file changed
Lines changed: 13 additions & 6 deletions
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
7 | 5 | | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
| |||
0 commit comments