Skip to content

Commit 3a68f09

Browse files
committed
fix tests on node 12 and 14
1 parent da3e63f commit 3a68f09

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,19 @@ it('async stack frames: Promise.any', async function() {
527527
});
528528

529529
it('wasm stack frames', async function() {
530+
const wasmFrame = semver.gte(process.versions.node, '16.0.0')
531+
? String.raw`wasm:\/\/wasm\/c2de0ab2:wasm-function\[1\]:0x3b`
532+
: semver.gte(process.versions.node, '14.0.0')
533+
? String.raw`call_js_function \(<anonymous>:wasm-function\[1\]:0x3b\)`
534+
// Node 12
535+
: String.raw`wasm-function\[1\]:0x3b`;
536+
530537
await compareStackTrace(createMultiLineSourceMap(), [
531538
'return require("./test-fixtures/wasm/wasm.js").call_js_function(() => { throw new Error("test"); });'
532539
], [
533540
'Error: test',
534541
re`^ at ${stackFramePathStartsWith()}(?:.*[/\\])?line1.js:1001:101$`,
535-
re`^ at wasm:\/\/wasm\/c2de0ab2:wasm-function\[1\]:0x3b$`,
542+
re`^ at ${wasmFrame}$`,
536543
re`^ at Object\.exports\.call_js_function \(.*[/\\]wasm\.js:13:24\)$`,
537544
]);
538545
});

0 commit comments

Comments
 (0)