Skip to content

Commit 0745a20

Browse files
committed
Fix tests
1 parent 6fa63af commit 0745a20

File tree

2 files changed

+19
-17
lines changed
  • dev-packages/node-integration-tests

2 files changed

+19
-17
lines changed

dev-packages/node-integration-tests/suites/thread-blocked-native/test.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ const ANR_EVENT = {
6565
exception: EXCEPTION(),
6666
};
6767

68-
const ANR_EVENT_WITH_DEBUG_META: Event = {
69-
...ANR_EVENT,
70-
debug_meta: {
71-
images: [
72-
{
73-
type: 'sourcemap',
74-
debug_id: 'aaaaaaaa-aaaa-4aaa-aaaa-aaaaaaaaaa',
75-
code_file: expect.stringContaining('basic'),
76-
},
77-
],
78-
},
79-
};
68+
function ANR_EVENT_WITH_DEBUG_META(file: string): Event {
69+
return {
70+
...ANR_EVENT,
71+
debug_meta: {
72+
images: [
73+
{
74+
type: 'sourcemap',
75+
debug_id: 'aaaaaaaa-aaaa-4aaa-aaaa-aaaaaaaaaa',
76+
code_file: expect.stringContaining(file),
77+
},
78+
],
79+
},
80+
};
81+
}
8082

8183
describe('Thread Blocked Native', { timeout: 30_000 }, () => {
8284
afterAll(() => {
@@ -86,15 +88,15 @@ describe('Thread Blocked Native', { timeout: 30_000 }, () => {
8688
test('CJS', async () => {
8789
await createRunner(__dirname, 'basic.js')
8890
.withMockSentryServer()
89-
.expect({ event: ANR_EVENT_WITH_DEBUG_META })
91+
.expect({ event: ANR_EVENT_WITH_DEBUG_META('basic') })
9092
.start()
9193
.completed();
9294
});
9395

9496
test('ESM', async () => {
9597
await createRunner(__dirname, 'basic.mjs')
9698
.withMockSentryServer()
97-
.expect({ event: ANR_EVENT_WITH_DEBUG_META })
99+
.expect({ event: ANR_EVENT_WITH_DEBUG_META('basic') })
98100
.start()
99101
.completed();
100102
});
@@ -123,8 +125,8 @@ describe('Thread Blocked Native', { timeout: 30_000 }, () => {
123125
test('multiple events via maxBlockedEvents', async () => {
124126
await createRunner(__dirname, 'basic-multiple.mjs')
125127
.withMockSentryServer()
126-
.expect({ event: ANR_EVENT_WITH_DEBUG_META })
127-
.expect({ event: ANR_EVENT_WITH_DEBUG_META })
128+
.expect({ event: ANR_EVENT_WITH_DEBUG_META('basic-multiple') })
129+
.expect({ event: ANR_EVENT_WITH_DEBUG_META('basic-multiple') })
128130
.start()
129131
.completed();
130132
});

dev-packages/node-integration-tests/utils/runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export function createRunner(...paths: string[]) {
450450

451451
if (process.env.DEBUG) log('starting scenario', testPath, flags, env.SENTRY_DSN);
452452

453-
child = spawn('node', [...flags, testPath], { env, stdio: process.env.DEBUG ? 'inherit' : 'ignore' });
453+
child = spawn('node', [...flags, testPath], { env });
454454

455455
child.on('error', e => {
456456
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)