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:
@@ -39,7 +39,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.10
|
bun-version: latest
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
@@ -56,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.10
|
bun-version: latest
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
@@ -81,7 +81,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.10
|
bun-version: latest
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
@@ -124,7 +124,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.10
|
bun-version: latest
|
||||||
|
|
||||||
- name: Generate release notes
|
- name: Generate release notes
|
||||||
id: notes
|
id: notes
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.10
|
bun-version: latest
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.10
|
bun-version: latest
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
@@ -81,7 +81,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.10
|
bun-version: latest
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -244,7 +244,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.10
|
bun-version: latest
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { afterAll, describe, expect, mock, test } from "bun:test"
|
|||||||
|
|
||||||
const logMock = mock(() => {})
|
const logMock = mock(() => {})
|
||||||
|
|
||||||
mock.module("../../shared", () => ({
|
mock.module("../../shared/logger", () => ({
|
||||||
log: logMock,
|
log: logMock,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import { afterAll, beforeEach, describe, expect, mock, test } from "bun:test"
|
import { afterAll, beforeEach, describe, expect, mock, test } from "bun:test"
|
||||||
|
|
||||||
mock.module("../../shared", () => ({
|
mock.module("../../shared/logger", () => ({
|
||||||
log: mock(() => {}),
|
log: mock(() => {}),
|
||||||
|
}))
|
||||||
|
|
||||||
|
mock.module("../../shared/connected-providers-cache", () => ({
|
||||||
readConnectedProvidersCache: mock(() => null),
|
readConnectedProvidersCache: mock(() => null),
|
||||||
readProviderModelsCache: mock(() => null),
|
readProviderModelsCache: mock(() => null),
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, test, expect, mock, afterAll } from "bun:test"
|
import { describe, test, expect, mock, afterAll } from "bun:test"
|
||||||
|
|
||||||
const mockLog = mock()
|
const mockLog = mock()
|
||||||
mock.module("../../shared", () => ({ log: mockLog }))
|
mock.module("../../shared/logger", () => ({ log: mockLog }))
|
||||||
|
|
||||||
afterAll(() => { mock.restore() })
|
afterAll(() => { mock.restore() })
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user