- Add zauc-mocks-bg, zauc-mocks-cache, zauc-mocks-hook,
zauc-mocks-ws, and zauc-sync-mocks directories
- Renamed from _auc-mocks-* to zauc-mocks-* for better organization
🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
- Delete background-update-check, cache, hook, workspace-resolution,
and sync-package-json isolated test directories
- These have been renamed/reorganized to zauc-mocks-* pattern
🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
- Change mock.module target from "../../shared" to "../../shared/claude-config-dir"
- Narrows mock scope to prevent barrel export contamination
🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
- Move mock.module() calls from top-level into importFreshSystemModule()
- Restore real modules in afterAll to prevent cross-test contamination
- Reset mocks before each test
🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
- Pin bun-version to 1.3.10 across all CI workflows to avoid
mock.module() barrel export regression introduced in 1.3.11
- Remove test:ci script from package.json (use bun test directly)
- Update publish-workflow.test.ts to expect "bun test" instead
🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
- Moved hook.test.ts, background-update-check.test.ts, workspace-resolution.test.ts, and cache.test.ts to separate sibling directories (_auc-mocks-hook, _auc-mocks-bg, _auc-mocks-ws, _auc-mocks-cache)
- Separated sync-package-json.test.ts to _auc-sync-mocks
- Fixed all relative import paths to account for new directory structure
- Bun runs same-directory test files in parallel; mock.module() calls contaminate each other. Only reliable isolation is separate directory = separate CI batch
- CI plan now creates individual isolated target for each mocking test file, preventing cross-file pollution
- Moved hook-integration tests → src/hooks/_auc-mocks-hook/
- Moved workspace-resolution tests → src/hooks/_auc-mocks-workspace/
- Moved background-update-check tests → src/hooks/_auc-mocks-bgupdate/
- Moved cache tests → src/hooks/_auc-mocks-cache/
- Moved sync-package-json tests → src/hooks/_auc-sync-mocks/
- Removed hook.test.ts, workspace-resolution.test.ts, background-update-check.test.ts from auto-update-checker
- Removed cache.test.ts from auto-update-checker
- Each test file with mock.module() now in its own isolated CI batch
- Bun's prefix glob matching was picking up _auc-mocks-* when running auto-update-checker
- Solution: Separate into dedicated directories prevents cross-contamination
CI Results: 3151 pass, 0 fail ✓
sync-package-json.test.ts mocks node:fs which leaks into plugin-entry.test.ts
running in the same CI batch. Move to checker/sync/ subdirectory for isolation.
hook.test.ts mocks ./checker at module load time, which contaminates
checker.test.ts and invalidate-package.test.ts running in parallel in
the same CI batch. Move to hook-integration/ subdirectory for CI batch
isolation.
mock.module('./executor') leaks across all files in the same batch because
Bun runs test files in a directory in parallel. The afterAll restore trick
doesn't work when other files load the module concurrently at startup.
Moving the leak test to its own subdirectory (leak/) ensures CI's batch
runner isolates it in a separate bun test invocation, preventing executor
mock contamination in executor-resolution.test.ts and index.test.ts.
mock.module('./executor') in auto-slash-command-leak.test.ts was leaking
into executor-resolution.test.ts in the same CI batch run, causing
executeSlashCommand to return the mock's raw replacement instead of the
real resolution result.
Fix: re-register the real executor exports via mock.module() in afterAll
so subsequent test files in the batch get the real implementation.
Three test files were mocking the entire '../../shared' barrel, which
corrupted exports for subsequent test files in the same batch run.
Narrow mocks to specific submodules (logger, connected-providers-cache).
Also reverts Bun version pin since the root cause was mock scope, not Bun.
Bun 1.3.11 has a regression where mock.module() leaks across test files
in isolated batch execution, causing barrel re-exports to fail with
'Export named X not found' errors. Pin to 1.3.10 until upstream fix.
OpenCode supports plugin entries as [string, object] tuples for passing
options, but loadOpencodePlugins assumed all entries were strings.
When a tuple entry hit matchesKnownPlugin, it called .toLowerCase()
on an array, crashing the plugin on startup.
Extract the string name from tuple entries and skip non-string values.
Add regression test covering the tuple plugin format.