fix(test): narrow mock.module() targets in background-agent tests to prevent barrel corruption
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.
This commit is contained in:
@@ -2,7 +2,7 @@ import { afterAll, describe, expect, mock, test } from "bun:test"
|
||||
|
||||
const logMock = mock(() => {})
|
||||
|
||||
mock.module("../../shared", () => ({
|
||||
mock.module("../../shared/logger", () => ({
|
||||
log: logMock,
|
||||
}))
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { afterAll, beforeEach, describe, expect, mock, test } from "bun:test"
|
||||
|
||||
mock.module("../../shared", () => ({
|
||||
mock.module("../../shared/logger", () => ({
|
||||
log: mock(() => {}),
|
||||
}))
|
||||
|
||||
mock.module("../../shared/connected-providers-cache", () => ({
|
||||
readConnectedProvidersCache: mock(() => null),
|
||||
readProviderModelsCache: mock(() => null),
|
||||
}))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, test, expect, mock, afterAll } from "bun:test"
|
||||
|
||||
const mockLog = mock()
|
||||
mock.module("../../shared", () => ({ log: mockLog }))
|
||||
mock.module("../../shared/logger", () => ({ log: mockLog }))
|
||||
|
||||
afterAll(() => { mock.restore() })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user