Commit b4bc06c
committed
test(doctor): use restorable spyOn for config mock in context.test
context.test.ts replaced the entire config.ts module via mock.module,
which is process-lifetime in Bun and omitted getConfigFile/_setConfigDir.
When the doctor folder ran in a single `bun test` process, the polluted
mock leaked into doctor.test.ts (which needs the real module), crashing
with "Export named 'getConfigFile' not found".
Swap the config mock for a spyOn on resolveProfile (the only symbol
context.ts imports) and restore it in afterAll, so doctor.test.ts gets
the real config.ts back.1 parent 428b2e9 commit b4bc06c
1 file changed
Lines changed: 9 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
9 | 4 | | |
10 | 5 | | |
11 | 6 | | |
| |||
15 | 10 | | |
16 | 11 | | |
17 | 12 | | |
| 13 | + | |
| 14 | + | |
18 | 15 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
| |||
0 commit comments