From e41763f8315d92d0d5bcd13f397f7d2f78f69745 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 25 Oct 2021 05:35:17 -0700 Subject: [PATCH] [Tests] node 17+ smooshes a version number on the end of the stack trace --- test/async-await.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/async-await.js b/test/async-await.js index 9f4cf90d..c3e1ce18 100644 --- a/test/async-await.js +++ b/test/async-await.js @@ -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; @@ -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\');', ' ^', @@ -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(); }); });