From 2f43caef012e8d1087cd112527ca2b96e71a55e6 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Tue, 22 Feb 2022 16:55:24 -0800 Subject: [PATCH] make http test trigger rewrapping of http functions --- packages/nextjs/test/integration/test/server/tracingHttp.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nextjs/test/integration/test/server/tracingHttp.js b/packages/nextjs/test/integration/test/server/tracingHttp.js index 02a61a78a047..6ce6ca14def6 100644 --- a/packages/nextjs/test/integration/test/server/tracingHttp.js +++ b/packages/nextjs/test/integration/test/server/tracingHttp.js @@ -40,7 +40,10 @@ module.exports = async ({ url: urlBase, argv }) => { 'tracingHttp', ); - await getAsync(url); + // The `true` causes `getAsync` to rewrap `http.get` in next 12, since it will have been overwritten by the import of + // `nock` above. See https://github.com/getsentry/sentry-javascript/pull/4619. + // TODO: see note in `getAsync` about removing the boolean + await getAsync(url, true); await sleep(250); assert.ok(capturedRequest.isDone(), 'Did not intercept expected request');