-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathtest.ts
38 lines (36 loc) · 1.06 KB
/
test.ts
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
34
35
36
37
38
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
afterAll(() => {
cleanupChildProcesses();
});
test('should capture and send Express controller error with txn name if tracesSampleRate is 0', done => {
createRunner(__dirname, 'server.ts')
.ignore('transaction')
.expect({
event: {
exception: {
values: [
{
mechanism: {
type: 'middleware',
handled: false,
},
type: 'Error',
value: 'test_error with id 123',
stacktrace: {
frames: expect.arrayContaining([
expect.objectContaining({
function: expect.any(String),
lineno: expect.any(Number),
colno: expect.any(Number),
}),
]),
},
},
],
},
transaction: 'GET /test/express/:id',
},
})
.start(done)
.makeRequest('get', '/test/express/123', { expectError: true });
});