From 75c40e8c2633ff1c42c90328bdd75981b2e489d1 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 4 Apr 2021 21:48:20 +0100 Subject: [PATCH] CLI: Upgrade `js-reporters` to 2.0.0 Fixes https://github.com/qunitjs/qunit/issues/1340. Fixes https://github.com/qunitjs/qunit/issues/1406. Fixes https://github.com/qunitjs/qunit/issues/1555. --- package-lock.json | 8 +-- package.json | 2 +- test/cli/fixtures/expected/tap-outputs.js | 71 +++++++++++++---------- 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ed65f9e7..f1e1ccd5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "qunit", - "version": "2.14.0-pre", + "version": "2.14.1-pre", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4002,9 +4002,9 @@ } }, "js-reporters": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/js-reporters/-/js-reporters-1.2.3.tgz", - "integrity": "sha512-2YzWkHbbRu6LueEs5ZP3P1LqbECvAeUJYrjw3H4y1ofW06hqCS0AbzBtLwbr+Hke51bt9CUepJ/Fj1hlCRIF6A==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/js-reporters/-/js-reporters-2.0.0.tgz", + "integrity": "sha512-VJd/86niT7GzsaVc+Yxrs8QPrYl1orzv8bYZPuSOtxU6rk/pv8aOXTcIa7HaANvtvdLMTsZspAiucNQ6T2QFHw==" }, "js-tokens": { "version": "3.0.2", diff --git a/package.json b/package.json index 87caf492c..f8b7791e6 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ }, "dependencies": { "commander": "7.1.0", - "js-reporters": "1.2.3", + "js-reporters": "2.0.0", "node-watch": "0.7.1", "tiny-glob": "0.2.8" }, diff --git a/test/cli/fixtures/expected/tap-outputs.js b/test/cli/fixtures/expected/tap-outputs.js index d43b64a18..c6cb34d26 100644 --- a/test/cli/fixtures/expected/tap-outputs.js +++ b/test/cli/fixtures/expected/tap-outputs.js @@ -56,11 +56,12 @@ ok 2 Second > 1 `TAP version 13 not ok 1 Throws match > bad --- - message: "match error" + message: match error severity: failed - actual : "Error: Match me with a pattern" + actual : Error: Match me with a pattern expected: "/incorrect pattern/" - stack: at Object. (/qunit/test/cli/fixtures/fail/throws-match.js:3:10) + stack: | + at Object. (/qunit/test/cli/fixtures/fail/throws-match.js:3:10) ... 1..1 # pass 0 @@ -113,27 +114,29 @@ Last test to run (hanging) has an async hold. Ensure all assert.async() callback `TAP version 13 not ok 1 Unhandled Rejections > test passes just fine, but has a rejected promise --- - message: "Error thrown in non-returned promise!" + message: Error thrown in non-returned promise! severity: failed actual : { "message": "Error thrown in non-returned promise!", "stack": "Error: Error thrown in non-returned promise!\\n at /some/path/wherever/unhandled-rejection.js:13:11" } expected: undefined - stack: Error: Error thrown in non-returned promise! - at /some/path/wherever/unhandled-rejection.js:13:11 + stack: | + Error: Error thrown in non-returned promise! + at /some/path/wherever/unhandled-rejection.js:13:11 ... not ok 2 global failure --- - message: "outside of a test context" + message: outside of a test context severity: failed actual : { "message": "outside of a test context", "stack": "Error: outside of a test context\\n at Object. (/some/path/wherever/unhandled-rejection.js:20:18)" } expected: undefined - stack: Error: outside of a test context - at Object. (/some/path/wherever/unhandled-rejection.js:20:18) + stack: | + Error: outside of a test context + at Object. (/some/path/wherever/unhandled-rejection.js:20:18) ... 1..2 # pass 0 @@ -146,16 +149,17 @@ not ok 2 global failure `TAP version 13 not ok 1 global failure --- - message: "No tests were run." + message: No tests were run. severity: failed actual : {} 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 internal + 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 internal ... 1..1 # pass 0 @@ -168,7 +172,7 @@ not ok 1 global failure ok 1 Example > good not ok 2 Example > bad --- - message: "failed" + message: failed severity: failed actual : false expected: true @@ -185,7 +189,7 @@ not ok 2 Example > bad ok 1 Example > good not ok 2 Example > bad --- - message: "failed" + message: failed severity: failed actual : false expected: true @@ -210,11 +214,12 @@ ok 1 ESM test suite > sum() `TAP version 13 not ok 1 timeout > first --- - message: "Test took longer than 10ms; test timed out." + message: Test took longer than 10ms; test timed out. severity: failed actual : null expected: undefined - stack: at internal + stack: | + at internal ... ok 2 timeout > second 1..2 @@ -232,21 +237,21 @@ ok 1 Zero assertions > has a test # todo 0 # fail 0`, - // Ignore the last frame about Node processing ticks (differs between Node 10 ad 12+) "qunit qunit --filter 'no matches' test": `TAP version 13 not ok 1 global failure --- - message: "No tests matched the filter "no matches"." + message: "No tests matched the filter \\"no matches\\"." severity: failed actual : {} 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 internal + 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 internal ... 1..1 # pass 0 @@ -289,11 +294,12 @@ ok 2 all tests with only run `TAP version 13 not ok 1 # TODO module B > Only this module should run > a todo test --- - message: "not implemented yet" + message: not implemented yet severity: todo actual : false expected: true - stack: at Object. (/qunit/test/cli/fixtures/only/module.js:17:15) + stack: | + at Object. (/qunit/test/cli/fixtures/only/module.js:17:15) ... ok 2 # SKIP module B > Only this module should run > implicitly skipped test ok 3 module B > Only this module should run > normal test @@ -310,11 +316,12 @@ ok 6 module E > test E `TAP version 13 not ok 1 # TODO module B > test B --- - message: "not implemented yet" + message: not implemented yet severity: todo actual : false expected: true - stack: at Object. (/qunit/test/cli/fixtures/only/module-flat.js:9:13) + stack: | + at Object. (/qunit/test/cli/fixtures/only/module-flat.js:9:13) ... ok 2 # SKIP module B > test C ok 3 module B > test D