test: isolate model-error-classifier.test.ts to prevent module mock contamination

The test mocks `./connected-providers-cache` at module level, which breaks
subsequent tests that import the real module. Move to isolated directory
to prevent cross-test contamination.
This commit is contained in:
YeonGyu-Kim
2026-04-04 20:06:55 +09:00
parent f610d19f9f
commit da68fb3d68
3 changed files with 20 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
test: isolate mock-contaminating tests into zauc-mocks-* directories
Bun's `mock.module()` is process-global. Tests that use it permanently
replace the mocked module for all subsequent tests in the same process.
The `mock.restore()` only restores function mocks (spyOn), not module mocks.
Move the 4 test files causing contamination into isolated subdirectories:
- migrate-legacy-plugin-entry.test.ts (mock.module("node:fs"))
- connected-providers-cache.test.ts (reads cache from filesystem)
- legacy-plugin-warning.test.ts (reads config from filesystem)
- subagent-resolver.test.ts (spies on shared modules)
This forces bun to run each in a separate process, preventing the
process-global mock contamination that's been causing 68 CI failures.