Skip to content

Commit d39e169

Browse files
author
Luca Forstner
committed
Losing my mind again
1 parent dc0fe4f commit d39e169

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

packages/nextjs/test/integration/instrumentation.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export function register() {
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
tracesSampleRate: 1.0,
8-
tracePropagationTargets: ['http://example.com'],
98
debug: !!process.env.SDK_DEBUG,
109
integrations: defaults => [
1110
...defaults.filter(
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
import { get } from 'http';
22
import { NextApiRequest, NextApiResponse } from 'next';
33

4-
const handler = async (_req: NextApiRequest, res: NextApiResponse): Promise<void> => {
4+
export default (_req: NextApiRequest, res: NextApiResponse) => {
55
// make an outgoing request in order to test that the `Http` integration creates a span
6-
await new Promise<void>(resolve =>
7-
get('http://example.com/', message => {
8-
message.on('data', () => {
9-
// Noop consuming some data so that request can close :)
10-
});
6+
get('http://example.com/', message => {
7+
message.on('data', () => {
8+
// Noop consuming some data so that request can close :)
9+
});
1110

12-
message.on('close', resolve);
13-
}),
14-
);
15-
16-
res.status(200).json({});
11+
message.on('close', () => {
12+
setTimeout(() => {
13+
res.status(200).json({});
14+
}, 1000);
15+
});
16+
});
1717
};
18-
19-
export default handler;

packages/nextjs/test/integration/test/server/tracingHttp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('Tracing HTTP', () => {
77
const url = `${env.url}/api/http`;
88

99
// this intercepts the outgoing request made by the route handler (which it makes in order to test span creation)
10-
nock('http://example.com').get('/').reply(200, 'ok');
10+
nock('http://example.com/').get('/').reply(200, 'ok');
1111

1212
const envelopes = await env.getMultipleEnvelopeRequest({
1313
url,

0 commit comments

Comments
 (0)