Skip to content

Commit 64b12a3

Browse files
committed
test: mock axios in notification plugin tests
1 parent 77e0ee7 commit 64b12a3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/notification/test/plugin.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ import { NotificationPlugin } from '../src/plugin.js';
66
import { NotificationChannel } from '../src/types.js';
77
import type { PluginContext } from '@objectstack/runtime';
88

9+
// Mock axios
10+
jest.mock('axios', () => {
11+
return {
12+
__esModule: true,
13+
default: jest.fn().mockResolvedValue({
14+
status: 200,
15+
statusText: 'OK',
16+
data: { success: true }
17+
})
18+
};
19+
});
20+
921
// Mock PluginContext
1022
const createMockContext = (): PluginContext => {
1123
const services = new Map();

turbo.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
},
88
"test": {
99
"dependsOn": ["^build"],
10-
"outputs": ["coverage/**"],
1110
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx", "vitest.config.ts", "jest.config.js", "jest.config.cjs", "jest.config.ts"]
1211
},
1312
"lint": {},

0 commit comments

Comments
 (0)