From 6350247ace9afdf2874fc618db96a2ce5ec98420 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');