Skip to content

Commit 37e446c

Browse files
committed
Use bind instead of domain.run plus minor runner fixes
1 parent 3491bfe commit 37e446c

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

packages/nextjs/src/utils/handlers.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export const withSentry = (handler: NextApiHandler): WrappedNextApiHandler => {
1919
const local = domain.create();
2020
local.add(req);
2121
local.add(res);
22-
23-
local.run(async () => {
22+
return local.bind(async () => {
2423
try {
2524
const currentScope = getCurrentHub().getScope();
2625

@@ -86,6 +85,6 @@ export const withSentry = (handler: NextApiHandler): WrappedNextApiHandler => {
8685
// no-empty
8786
}
8887
}
89-
});
88+
})();
9089
};
9190
};

packages/nextjs/test/integration/test/client/errorClick.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const { waitForAll } = require('../utils/common');
22
const { expectRequestCount, isEventRequest, expectEvent } = require('../utils/client');
33

44
module.exports = async ({ page, url, requests }) => {
5-
console.log(page, url, requests);
65
await page.goto(`${url}/errorClick`);
76

87
await waitForAll([page.click('button'), page.waitForRequest(isEventRequest)]);

packages/nextjs/test/integration/test/runner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module.exports.run = async ({
6666

6767
let scenarios = await fs.readdir(scenariosDir);
6868
if (argv.filter) {
69-
scenarios = scenarios.filter(file => file.toLowerCase().includes(argv.filter));
69+
scenarios = scenarios.filter(file => file.toLowerCase().includes(argv.filter.toLowerCase()));
7070
}
7171
scenarios = scenarios.map(s => path.resolve(scenariosDir, s));
7272

packages/nextjs/test/integration/test/utils/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const logIf = (condition, message, input, depth = 4) => {
3737
if (condition) {
3838
console.log(message);
3939
if (input) {
40-
console.log(inspect(input, { depth }));
40+
console.log(JSON.stringify(input, null, 2));
4141
}
4242
}
4343
};

0 commit comments

Comments
 (0)