-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
stdout: `::debug::starting to run tests | ||
::debug::starting to run is ok | ||
::debug::completed running is ok | ||
::debug::starting to run fails | ||
::error title=fails,file=tests/example.js::\\[Error \\[ERR_TEST_FAILURE\\]: this is an error\\] {%0A failureType: 'testCodeFailure',%0A cause: Error: this is an error%0A at .*.<anonymous> (.*/example.js:6:11).* | ||
::debug::starting to run is a diagnostic | ||
::debug::completed running is a diagnostic | ||
::notice file=tests/example.js::this is a diagnostic | ||
::error title=tests,file=tests/example.js::\\[Error \\[ERR_TEST_FAILURE\\]: 1 subtest failed\\] { failureType: 'subtestsFailed', cause: '1 subtest failed', code: 'ERR_TEST_FAILURE' } | ||
::debug::starting to run more tests | ||
::debug::starting to run is ok | ||
::debug::completed running is ok | ||
::debug::completed running more tests | ||
::group::Test results \\(4 passed, 2 failed\\) | ||
::notice::Total Tests: 4%0ASuites 📂: 2%0APassed ✅: 3%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 0%0ATodo 📝: 0%0ADuration 🕐: .*ms | ||
::endgroup:: | ||
`, | ||
summary: `<h1>Test Results</h1> | ||
<table><tr><td>Total Tests</td><td>4</td></tr><tr><td>Suites 📂</td><td>2</td></tr><tr><td>Passed ✅</td><td>3</td></tr><tr><td>Failed ❌</td><td>1</td></tr><tr><td>Canceled 🚫</td><td>0</td></tr><tr><td>Skipped ⏭️</td><td>0</td></tr><tr><td>Todo 📝</td><td>0</td></tr><tr><td>Duration 🕐</td><td>.*ms</td></tr></table> | ||
`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
stdout: `::debug::starting to run tests | ||
::debug::starting to run is ok | ||
::debug::completed running is ok | ||
::debug::starting to run fails | ||
::error title=fails,file=tests/example.js::\\[Error \\[ERR_TEST_FAILURE\\]: this is an error\\] {%0A failureType: 'testCodeFailure',%0A cause: Error: this is an error%0A at .*.<anonymous> (.*/example.js:6:11).* | ||
::debug::starting to run is a diagnostic | ||
::debug::completed running is a diagnostic | ||
::notice file=tests/example.js::this is a diagnostic | ||
::error title=tests,file=tests/example.js::\\[Error \\[ERR_TEST_FAILURE\\]: 1 subtest failed\\] { failureType: 'subtestsFailed', cause: '1 subtest failed', code: 'ERR_TEST_FAILURE' } | ||
::debug::starting to run more tests | ||
::debug::starting to run is ok | ||
::debug::completed running is ok | ||
::debug::completed running more tests | ||
::group::Test results \\(4 passed, 2 failed\\) | ||
::notice::Total Tests: 4%0ASuites 📂: 2%0APassed ✅: 3%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 0%0ATodo 📝: 0%0ADuration 🕐: .*ms | ||
::endgroup:: | ||
`, | ||
summary: `<h1>Test Results</h1> | ||
<table><tr><td>Total Tests</td><td>4</td></tr><tr><td>Suites 📂</td><td>2</td></tr><tr><td>Passed ✅</td><td>3</td></tr><tr><td>Failed ❌</td><td>1</td></tr><tr><td>Canceled 🚫</td><td>0</td></tr><tr><td>Skipped ⏭️</td><td>0</td></tr><tr><td>Todo 📝</td><td>0</td></tr><tr><td>Duration 🕐</td><td>.*ms</td></tr></table> | ||
`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
stdout: `<\\?xml version="1.0" encoding="utf-8"\\?> | ||
<testsuites> | ||
\t<testsuite name="tests" time=".*" disabled="0" errors="0" tests="3" failures="1" skipped="0" hostname=".*"> | ||
\t\t<testcase name="is ok" time=".*" classname="test"/> | ||
\t\t<testcase name="fails" time=".*" classname="test" failure="this is an error"> | ||
\t\t\t<failure type="testCodeFailure" message="this is an error"> | ||
\\[Error \\[ERR_TEST_FAILURE\\]: this is an error\\] { | ||
failureType: 'testCodeFailure', | ||
cause: Error: this is an error | ||
.* | ||
.* | ||
.* | ||
.* | ||
.* | ||
.* | ||
.* | ||
.* | ||
.* | ||
code: 'ERR_TEST_FAILURE' | ||
} | ||
\t\t\t</failure> | ||
\t\t</testcase> | ||
\t\t<testcase name="is a diagnostic" time=".*" classname="test"/> | ||
\t</testsuite> | ||
\t<testsuite name="more tests" time=".*" disabled="0" errors="0" tests="1" failures="0" skipped="0" hostname=".*"> | ||
\t\t<testcase name="is ok" time=".*" classname="test"/> | ||
\t</testsuite> | ||
</testsuites> | ||
`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const { spawnSync } = require('child_process'); | ||
const assert = require('assert'); | ||
|
||
const child = spawnSync(process.execPath, ['--test-reporter', './index.js', '../../tests/example']); | ||
const child = spawnSync(process.execPath, ['--test-reporter', './index.js', '../../tests/example'], { env: {} }); | ||
|
||
assert.strictEqual(child.stderr?.toString(), ''); | ||
assert.strictEqual(child.stdout?.toString(), ''); |