Skip to content

Commit 1c75eb7

Browse files
committed
test: use URLs when examine the stack trace
Windows path (using backslash) won't be found in stack trace anymore. Use appropriate url.fileURLToPath and url.pathToFileURL when examine the stack trace.
1 parent 31c0d2d commit 1c75eb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-http-timeout-client-warning.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
const common = require('../common');
33
const http = require('http');
44
const assert = require('assert');
5+
const { pathToFileURL } = require('url');
56

67
// Checks that the setTimeout duration overflow warning is emitted
78
// synchronously and therefore contains a meaningful stacktrace.
89

910
process.on('warning', common.mustCall((warning) => {
10-
assert(warning.stack.includes(__filename));
11+
assert(warning.stack.includes(pathToFileURL(__filename)));
1112
}));
1213

1314
const server = http.createServer((req, resp) => resp.end());

0 commit comments

Comments
 (0)