Commit 710b01b
committed
test(config): make export() token-filter tests deterministic & isolation-safe (#161)
The GLM export test passed on ubuntu/local but failed on Windows CI, which runs
vitest with poolOptions.forks.singleFork. ProviderSettingsManager.spec used the
real buildApiHandler, so a sibling spec's module-level vi.mock("../../../api")
(e.g. importExport.spec) could bleed in under reduced isolation, making
supportsMaxTokens read as undefined and dropping modelMaxTokens.
Mock buildApiHandler in this file, deriving model capabilities from the real
@roo-code/types definitions via importActual. The Export tests now exercise the
token-field filtering deterministically and are immune to cross-file api mocks,
while still validating real model capabilities (glm-5.1 supportsMaxTokens, etc.).1 parent 6cdbb6b commit 710b01b
1 file changed
Lines changed: 31 additions & 0 deletions
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
9 | 40 | | |
10 | 41 | | |
11 | 42 | | |
| |||
0 commit comments