diff --git a/test/cli/fixtures/expected/tap-outputs.js b/test/cli/fixtures/expected/tap-outputs.js index a90ec4544..a76a2c2d6 100644 --- a/test/cli/fixtures/expected/tap-outputs.js +++ b/test/cli/fixtures/expected/tap-outputs.js @@ -114,8 +114,7 @@ Last test to run (hanging) has an async hold. Ensure all assert.async() callback stack: | Error: outside of a test context at /qunit/test/cli/fixtures/unhandled-rejection.js:17:18 - at processModule (/qunit/qunit/qunit.js) - at Object.module$1 [as module] (/qunit/qunit/qunit.js) + at qunit.js at /qunit/test/cli/fixtures/unhandled-rejection.js:3:7 at internal ... @@ -149,10 +148,7 @@ not ok 1 global failure expected: undefined stack: | Error: No tests were run. - at done (/qunit/qunit/qunit.js) - at advanceTestQueue (/qunit/qunit/qunit.js) - at Object.advance (/qunit/qunit/qunit.js) - at unblockAndAdvanceQueue (/qunit/qunit/qunit.js) + at qunit.js at internal ... 1..1 @@ -254,10 +250,7 @@ not ok 1 global failure expected: undefined stack: | Error: No tests matched the filter "no matches". - at done (/qunit/qunit/qunit.js) - at advanceTestQueue (/qunit/qunit/qunit.js) - at Object.advance (/qunit/qunit/qunit.js) - at unblockAndAdvanceQueue (/qunit/qunit/qunit.js) + at qunit.js at internal ... 1..1 @@ -487,7 +480,7 @@ not ok 1 global failure stack: | Error: No dice at /qunit/test/cli/fixtures/bad-callbacks/begin-throw.js:2:8 - at /qunit/qunit/qunit.js + at qunit.js at internal ... Bail out! Error: No dice`, @@ -507,7 +500,7 @@ Bail out! Error: No dice stack: | Error: No dice at /qunit/test/cli/fixtures/bad-callbacks/done-throw.js:2:8 - at /qunit/qunit/qunit.js + at qunit.js at internal ...`, @@ -585,7 +578,7 @@ Bail out! Error: Unexpected release of async pause after tests finished. stack: | Error: Unexpected release of async pause after tests finished. > Test: extra done scheduled outside any test [async #1] - at Timeout.release [as _onTimeout] (/qunit/qunit/qunit.js) + at qunit.js at internal ...`, diff --git a/test/cli/helpers/execute.js b/test/cli/helpers/execute.js index 2f28e9381..8c09a0c1c 100644 --- a/test/cli/helpers/execute.js +++ b/test/cli/helpers/execute.js @@ -18,11 +18,12 @@ function normalize( actual ) { // Replace backslashes (\) in stack traces on Windows to POSIX .replace( reSep, "/" ) - // Convert "at processModule (/qunit/qunit/qunit.js:1:2)" to "at processModule (/qunit/qunit/qunit.js)" - .replace( /(\/qunit\/qunit\/qunit\.js):\d+:\d+\)/g, "$1)" ) + // Convert "at processModule (/qunit/qunit/qunit.js:1:2)" to "at qunit.js" + // Convert "at /qunit/qunit/qunit.js:1:2" to "at qunit.js" + .replace( /^(\s+at ).*\/qunit\/qunit\/qunit\.js.*$/gm, "$1qunit.js" ) - // Convert "at /qunit/qunit/qunit.js:1:2" to "at /qunit/qunit/qunit.js" - .replace( /( {2}at \/qunit\/qunit\/qunit\.js):\d+:\d+/g, "$1" ) + // Convert any "/qunit/qunit/qunit.js:1:2" to "/qunit/qunit/qunit.js" + .replace( /(\/qunit\/qunit\/qunit\.js):\d+:\d+/g, "$1" ) // Strip inferred names for anonymous test closures (as Node 10 did), // to match the output of Node 12+. @@ -48,11 +49,11 @@ function normalize( actual ) { // Convert "at load (/qunit/node_modules/append-transform/index.js:6" to "at internal" .replace( / {2}at .+\/.*node_modules\/append-transform\/.*\)/g, " at internal" ) - // merge successive lines after initial frame - .replace( /(\n\s+at internal)+/g, "$1" ) + // Consolidate subsequent qunit.js frames + .replace( /^(\s+at qunit\.js$)(\n\s+at qunit\.js$)+/gm, "$1" ) - // merge successive line with initial frame - .replace( /(at internal)\n\s+at internal/g, "$1" ); + // Consolidate subsequent internal frames + .replace( /^(\s+at internal$)(\n\s+at internal$)+/gm, "$1" ); } /**