Skip to content

Commit

Permalink
tests: update tests to reflect latest node updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Sep 10, 2024
1 parent b0d8de1 commit b77cef4
Show file tree
Hide file tree
Showing 27 changed files with 101 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [v18, v20, v21]
node: [v18, v20, v22]
steps:
- uses: actions/checkout@v3
with:
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"mono": "c8 node scripts/mono-run.js",
"test": "yarn mono test",
"test:clean-snapshots": "rm -rf packages/**/.snapshots",
"lint": "eslint ."
},
"workspaces": [
Expand All @@ -21,10 +22,11 @@
},
"homepage": "https://github.com/MoLow/reporters#readme",
"devDependencies": {
"@matteo.collina/snap": "^0.2.1",
"@matteo.collina/snap": "^0.3.0",
"c8": "^7.13.0",
"eslint": "^7.32.0 || ^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.25.2"
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"stderr": "",
"stdout": "::debug::starting to run tests\n::debug::starting to run is ok\n::debug::completed running is ok\n::debug::starting to run fails\n::error title=fails,file=tests/example.js,line=9,col=11::Error [ERR_TEST_FAILURE]: this is an error%0A at async Promise.all (index 0) {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: Error: this is an error%0A at TestContext.<anonymous> (CWD/tests/example.js:9:11)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:856:25)%0A at Suite.processPendingSubtests (node:internal/test_runner/test:565:18)%0A at Test.postRun (node:internal/test_runner/test:955:19)%0A at Test.run (node:internal/test_runner/test:898:12)%0A at async Promise.all (index 0)%0A at async Suite.run (node:internal/test_runner/test:1217:7)%0A at async Test.processPendingSubtests (node:internal/test_runner/test:565:7)%0A}\n::debug::starting to run is a diagnostic\n::debug::completed running is a diagnostic\n::notice file=tests/example.js,line=11,col=3::this is a diagnostic\n::debug::starting to run should fail\n::error title=should fail,file=tests/example.js,line=12,col=31::[Error [ERR_TEST_FAILURE]: The expression evaluated to a falsy value:%0A%0A assert(false)%0A] {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:%0A %0A assert(false)%0A %0A at TestContext.<anonymous> (CWD/tests/example.js:12:31)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:856:25)%0A at Suite.processPendingSubtests (node:internal/test_runner/test:565:18)%0A at Test.postRun (node:internal/test_runner/test:955:19)%0A at Test.run (node:internal/test_runner/test:898:12)%0A at async Suite.processPendingSubtests (node:internal/test_runner/test:565:7) {%0A generatedMessage: true,%0A code: 'ERR_ASSERTION',%0A actual: false,%0A expected: true,%0A operator: '=='%0A }%0A}\n::debug::starting to run more tests\n::debug::starting to run is ok\n::debug::completed running is ok\n::debug::completed running more tests\n::debug::starting to run is skipped\n::debug::completed running is skipped\n::debug::starting to run is a todo\n::debug::completed running is a todo\n::debug::starting to run top level diagnostic\n::debug::completed running top level diagnostic\n::notice file=tests/example.js,line=21,col=1::top level diagnostic\n::group::Test results (4 passed, 2 failed)\n::notice::Total Tests: 8%0ASuites 📂: 2%0APassed ✅: 4%0AFailed ❌: 2%0ACanceled 🚫: 0%0ASkipped ⏭️: 1%0ATodo 📝: 1%0ADuration 🕐: *ms\n::endgroup::\n",
"exitCode": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"stderr": "",
"stdout": "::debug::starting to run should fail\n::error title=should fail,file=tests/example.mjs,line=5,col=3::Error [ERR_TEST_FAILURE]: The expression evaluated to a falsy value:%0A%0A assert(false)%0A%0A at AsyncResource.runInAsyncScope (node:async_hooks:206:9) {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:%0A %0A assert(false)%0A %0A at TestContext.<anonymous> (file://CWD/tests/example.mjs:5:3)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:856:25)%0A at Test.processPendingSubtests (node:internal/test_runner/test:565:18)%0A at node:internal/test_runner/harness:248:12%0A at node:internal/process/task_queues:140:7%0A at AsyncResource.runInAsyncScope (node:async_hooks:206:9)%0A at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8) {%0A generatedMessage: true,%0A code: 'ERR_ASSERTION',%0A actual: false,%0A expected: true,%0A operator: '=='%0A }%0A}\n::debug::starting to run should pass\n::debug::completed running should pass\n::group::Test results (1 passed, 1 failed)\n::notice::Total Tests: 2%0ASuites 📂: 0%0APassed ✅: 1%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 0%0ATodo 📝: 0%0ADuration 🕐: *ms\n::endgroup::\n",
"exitCode": 1
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"stderr": "",
"stdout": "::debug::starting to run tests\n::debug::starting to run is ok\n::debug::completed running is ok\n::debug::starting to run fails\n::error title=fails,file=tests/example.js,line=9,col=11::[Error [ERR_TEST_FAILURE]: this is an error] {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: Error: this is an error%0A at TestContext.<anonymous> (CWD/tests/example.js:9:11)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:631:25)%0A at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)%0A at Test.postRun (node:internal/test_runner/test:715:19)%0A at Test.run (node:internal/test_runner/test:673:12)%0A at async Promise.all (index 0)%0A at async Suite.run (node:internal/test_runner/test:948:7)%0A at async startSubtest (node:internal/test_runner/harness:216:3)%0A}\n::debug::starting to run is a diagnostic\n::debug::completed running is a diagnostic\n::notice file=tests/example.js,line=11,col=3::this is a diagnostic\n::debug::starting to run should fail\n::error title=should fail,file=tests/example.js,line=12,col=31::[Error [ERR_TEST_FAILURE]: The expression evaluated to a falsy value:%0A%0A assert(false)%0A] {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:%0A %0A assert(false)%0A %0A at TestContext.<anonymous> (CWD/tests/example.js:12:31)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:631:25)%0A at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)%0A at Test.postRun (node:internal/test_runner/test:715:19)%0A at Test.run (node:internal/test_runner/test:673:12)%0A at async Suite.processPendingSubtests (node:internal/test_runner/test:374:7) {%0A generatedMessage: true,%0A code: 'ERR_ASSERTION',%0A actual: false,%0A expected: true,%0A operator: '=='%0A }%0A}\n::debug::starting to run more tests\n::debug::starting to run is ok\n::debug::completed running is ok\n::debug::completed running more tests\n::debug::starting to run is skipped\n::debug::completed running is skipped\n::debug::starting to run is a todo\n::debug::completed running is a todo\n::debug::starting to run top level diagnostic\n::debug::completed running top level diagnostic\n::notice file=tests/example.js,line=21,col=1::top level diagnostic\n::group::Test results (4 passed, 2 failed)\n::notice::Total Tests: 8%0ASuites 📂: 2%0APassed ✅: 4%0AFailed ❌: 2%0ACanceled 🚫: 0%0ASkipped ⏭️: 1%0ATodo 📝: 1%0ADuration 🕐: *ms\n::endgroup::\n",
"stdout": "::debug::starting to run tests\n::debug::starting to run is ok\n::debug::completed running is ok\n::debug::starting to run fails\n::error title=fails,file=tests/example.js,line=9,col=11::Error [ERR_TEST_FAILURE]: this is an error%0A at async Promise.all (index 0) {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: Error: this is an error%0A at TestContext.<anonymous> (CWD/tests/example.js:9:11)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:789:25)%0A at Suite.processPendingSubtests (node:internal/test_runner/test:517:18)%0A at Test.postRun (node:internal/test_runner/test:885:19)%0A at Test.run (node:internal/test_runner/test:831:12)%0A at async Promise.all (index 0)%0A at async Suite.run (node:internal/test_runner/test:1131:7)%0A at async Test.processPendingSubtests (node:internal/test_runner/test:517:7)%0A}\n::debug::starting to run is a diagnostic\n::debug::completed running is a diagnostic\n::notice file=tests/example.js,line=11,col=3::this is a diagnostic\n::debug::starting to run should fail\n::error title=should fail,file=tests/example.js,line=12,col=31::[Error [ERR_TEST_FAILURE]: The expression evaluated to a falsy value:%0A%0A assert(false)%0A] {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:%0A %0A assert(false)%0A %0A at TestContext.<anonymous> (CWD/tests/example.js:12:31)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:789:25)%0A at Suite.processPendingSubtests (node:internal/test_runner/test:517:18)%0A at Test.postRun (node:internal/test_runner/test:885:19)%0A at Test.run (node:internal/test_runner/test:831:12)%0A at async Suite.processPendingSubtests (node:internal/test_runner/test:517:7) {%0A generatedMessage: true,%0A code: 'ERR_ASSERTION',%0A actual: false,%0A expected: true,%0A operator: '=='%0A }%0A}\n::debug::starting to run more tests\n::debug::starting to run is ok\n::debug::completed running is ok\n::debug::completed running more tests\n::debug::starting to run is skipped\n::debug::completed running is skipped\n::debug::starting to run is a todo\n::debug::completed running is a todo\n::debug::starting to run top level diagnostic\n::debug::completed running top level diagnostic\n::notice file=tests/example.js,line=21,col=1::top level diagnostic\n::group::Test results (4 passed, 2 failed)\n::notice::Total Tests: 8%0ASuites 📂: 2%0APassed ✅: 4%0AFailed ❌: 2%0ACanceled 🚫: 0%0ASkipped ⏭️: 1%0ATodo 📝: 1%0ADuration 🕐: *ms\n::endgroup::\n",
"exitCode": 1
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"stderr": "",
"stdout": "::debug::starting to run should fail\n::error title=should fail,file=tests/example.mjs,line=5,col=3::[Error [ERR_TEST_FAILURE]: The expression evaluated to a falsy value:%0A%0A assert(false)%0A] {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:%0A %0A assert(false)%0A %0A at TestContext.<anonymous> (file://CWD/tests/example.mjs:5:3)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:631:25)%0A at Test.start (node:internal/test_runner/test:542:17)%0A at startSubtest (node:internal/test_runner/harness:216:17) {%0A generatedMessage: true,%0A code: 'ERR_ASSERTION',%0A actual: false,%0A expected: true,%0A operator: '=='%0A }%0A}\n::debug::starting to run should pass\n::debug::completed running should pass\n::group::Test results (1 passed, 1 failed)\n::notice::Total Tests: 2%0ASuites 📂: 0%0APassed ✅: 1%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 0%0ATodo 📝: 0%0ADuration 🕐: *ms\n::endgroup::\n",
"stdout": "::debug::starting to run should fail\n::error title=should fail,file=tests/example.mjs,line=5,col=3::Error [ERR_TEST_FAILURE]: The expression evaluated to a falsy value:%0A%0A assert(false)%0A%0A at AsyncResource.runInAsyncScope (node:async_hooks:206:9) {%0A code: 'ERR_TEST_FAILURE',%0A failureType: 'testCodeFailure',%0A cause: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:%0A %0A assert(false)%0A %0A at TestContext.<anonymous> (file://CWD/tests/example.mjs:5:3)%0A at Test.runInAsyncScope (node:async_hooks:206:9)%0A at Test.run (node:internal/test_runner/test:789:25)%0A at Test.processPendingSubtests (node:internal/test_runner/test:517:18)%0A at node:internal/test_runner/harness:252:12%0A at node:internal/process/task_queues:140:7%0A at AsyncResource.runInAsyncScope (node:async_hooks:206:9)%0A at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8) {%0A generatedMessage: true,%0A code: 'ERR_ASSERTION',%0A actual: false,%0A expected: true,%0A operator: '=='%0A }%0A}\n::debug::starting to run should pass\n::debug::completed running should pass\n::group::Test results (1 passed, 1 failed)\n::notice::Total Tests: 2%0ASuites 📂: 0%0APassed ✅: 1%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 0%0ATodo 📝: 0%0ADuration 🕐: *ms\n::endgroup::\n",
"exitCode": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"stderr": "",
"stdout": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<testsuites>\n\t<testcase name=\"should fail\" time=\"*\" classname=\"test\" failure=\"The expression evaluated to a falsy value: assert(false)\">\n\t\t<failure type=\"testCodeFailure\" message=\"The expression evaluated to a falsy value: assert(false)\">\nError [ERR_TEST_FAILURE]: The expression evaluated to a falsy value:\n\n assert(false)\n\n * {\n code: 'ERR_TEST_FAILURE',\n failureType: 'testCodeFailure',\n cause: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:\n \n assert(false)\n \n *\n *\n *\n *\n *\n *\n *\n * {\n generatedMessage: true,\n code: 'ERR_ASSERTION',\n actual: false,\n expected: true,\n operator: '=='\n }\n}\n\t\t</failure>\n\t</testcase>\n\t<testcase name=\"should pass\" time=\"*\" classname=\"test\"/>\n</testsuites>\n",
"exitCode": 1
}

This file was deleted.

Loading

0 comments on commit b77cef4

Please sign in to comment.