Skip to content

Commit 458f9df

Browse files
committed
fix one test
1 parent c8a0b35 commit 458f9df

File tree

2 files changed

+17
-2
lines changed
  • dev-packages/node-integration-tests/suites/express/multiple-init

2 files changed

+17
-2
lines changed

dev-packages/node-integration-tests/suites/express/multiple-init/server.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,19 @@ app.get('/test/error/:id', (req, res) => {
5454

5555
setTimeout(() => {
5656
// We flush to ensure we are sending exceptions in a certain order
57-
Sentry.flush(3000).then(
57+
Sentry.flush(1000).then(
5858
() => {
59+
// We send this so we can wait for this, to know the test is ended & server can be closed
60+
if (id === '3') {
61+
Sentry.captureException(new Error('Final exception was captured'));
62+
}
5963
res.send({});
6064
},
6165
() => {
6266
res.send({});
6367
},
6468
);
65-
}, 1000);
69+
}, 1);
6670
});
6771

6872
Sentry.setupExpressErrorHandler(app);

dev-packages/node-integration-tests/suites/express/multiple-init/test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ test('allows to call init multiple times', done => {
4848
},
4949
},
5050
})
51+
.expect({
52+
event: {
53+
exception: {
54+
values: [
55+
{
56+
value: 'Final exception was captured',
57+
},
58+
],
59+
},
60+
},
61+
})
5162
.start(done);
5263

5364
runner

0 commit comments

Comments
 (0)