Skip to content

Commit

Permalink
[Tests] node 17+ smooshes a version number on the end of the stack trace
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 25, 2021
1 parent f040c4f commit e41763f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/async-await.js
Expand Up @@ -12,6 +12,8 @@ if (Number(majorVersion) < 8) {
process.exit(0); // eslint-disable-line no-process-exit
}

var node17 = Number(majorVersion) >= 17;

var lengthMessage = 'Cannot read property \'length\' of null';
try {
lengthMessage = null.length;
Expand Down Expand Up @@ -201,7 +203,7 @@ tap.test('sync-error', function (t) {
});
stderr = lines.join('\n');

t.same(stripFullStack(stderr), [
t.same(stripFullStack(stderr), [].concat(
'$TEST/async-await/sync-error.js:7',
' throw new Error(\'oopsie\');',
' ^',
Expand All @@ -211,8 +213,12 @@ tap.test('sync-error', function (t) {
' at Test.bound [as _cb] ($TAPE/lib/test.js:$LINE:$COL)',
' at Test.run ($TAPE/lib/test.js:$LINE:$COL)',
' at Test.bound [as run] ($TAPE/lib/test.js:$LINE:$COL)',
node17 ? [
'',
'Node.js ' + process.version
] : [],
''
]);
));
t.end();
});
});
Expand Down

0 comments on commit e41763f

Please sign in to comment.