-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
33 lines (31 loc) · 912 Bytes
/
test.ts
File metadata and controls
33 lines (31 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { afterAll, describe } from 'vitest';
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../../utils/runner';
describe('express with http import', () => {
afterAll(() => {
cleanupChildProcesses();
});
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => {
test('it works when importing the http module', async () => {
const runner = createRunner()
.expect({
transaction: {
transaction: 'GET /test2',
},
})
.expect({
transaction: {
transaction: 'GET /test',
},
})
.expect({
transaction: {
transaction: 'GET /test3',
},
})
.start();
await runner.makeRequest('get', '/test');
await runner.makeRequest('get', '/test3');
await runner.completed();
});
});
});