|
| 1 | +import { cleanupChildProcesses, createRunner } from '../../../utils/runner'; |
| 2 | + |
| 3 | +afterAll(() => { |
| 4 | + cleanupChildProcesses(); |
| 5 | +}); |
| 6 | + |
| 7 | +test('correctly applies isolation scope even without tracing', done => { |
| 8 | + const runner = createRunner(__dirname, 'server.ts') |
| 9 | + .ignore('session', 'sessions') |
| 10 | + .expect({ |
| 11 | + event: { |
| 12 | + tags: { |
| 13 | + global: 'tag', |
| 14 | + 'isolation-scope': 'tag', |
| 15 | + 'isolation-scope-1': '1', |
| 16 | + // We can't properly test non-existance of fields here, so we cast this to a string to test it here |
| 17 | + 'isolation-scope-transactionName': 'undefined', |
| 18 | + }, |
| 19 | + // Request is correctly set |
| 20 | + request: { |
| 21 | + url: expect.stringContaining('/test/isolationScope/1'), |
| 22 | + headers: { |
| 23 | + 'user-agent': expect.stringContaining(''), |
| 24 | + }, |
| 25 | + }, |
| 26 | + }, |
| 27 | + }) |
| 28 | + .expect({ |
| 29 | + event: { |
| 30 | + tags: { |
| 31 | + global: 'tag', |
| 32 | + 'isolation-scope': 'tag', |
| 33 | + 'isolation-scope-2': '2', |
| 34 | + // We can't properly test non-existance of fields here, so we cast this to a string to test it here |
| 35 | + 'isolation-scope-transactionName': 'undefined', |
| 36 | + }, |
| 37 | + // Request is correctly set |
| 38 | + request: { |
| 39 | + url: expect.stringContaining('/test/isolationScope/2'), |
| 40 | + headers: { |
| 41 | + 'user-agent': expect.stringContaining(''), |
| 42 | + }, |
| 43 | + }, |
| 44 | + }, |
| 45 | + }) |
| 46 | + .start(done); |
| 47 | + |
| 48 | + runner.makeRequest('get', '/test/isolationScope/1').then(() => runner.makeRequest('get', '/test/isolationScope/2')); |
| 49 | +}); |
0 commit comments