Skip to content

Commit fd05dbe

Browse files
committed
Fix Composio web test isolation
1 parent 9d7ab61 commit fd05dbe

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

web/src/app/api/v1/composio/__tests__/composio.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ let postComposioExecute: typeof PostComposioExecute
2020

2121
beforeAll(async () => {
2222
mock.module('server-only', () => ({}))
23+
mock.module('@codebuff/internal/env', () => ({
24+
env: { COMPOSIO_API_KEY: 'test-composio-api-key' },
25+
}))
2326
;({ postComposioExecute } = await import('../execute/_post'))
2427
})
2528

web/src/server/__tests__/composio.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ let execute: ReturnType<typeof mock>
1111

1212
beforeAll(async () => {
1313
mock.module('server-only', () => ({}))
14+
mock.module('@codebuff/internal/env', () => ({
15+
env: { COMPOSIO_API_KEY: 'test-composio-api-key' },
16+
}))
1417
mock.module('@composio/core', () => ({
1518
Composio: class {
1619
create = createSession

web/src/test-stubs/bun-test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {
2+
afterAll,
23
afterEach,
4+
beforeAll,
35
beforeEach,
46
describe,
57
expect,
@@ -29,4 +31,14 @@ mock.module = (moduleName, factory) => {
2931
jest.mock(moduleName, factory)
3032
}
3133

32-
export { afterEach, beforeEach, describe, expect, it, test, mock }
34+
export {
35+
afterAll,
36+
afterEach,
37+
beforeAll,
38+
beforeEach,
39+
describe,
40+
expect,
41+
it,
42+
test,
43+
mock,
44+
}

0 commit comments

Comments
 (0)