mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-10 04:01:10 +02:00
Ignore pending tests in the custom reporters
Similar to excluded tests pending tests should not count towards runs or result in console logging because they are effectively not (fully) run. This reduces visual noise and helps to get the tests running on GitHub Actions where non-passed tests will count towards a non-zero exit code.
This commit is contained in:
parent
8a5f6f5157
commit
5fb9f12d3e
@ -52,10 +52,12 @@ async function runTests(results) {
|
||||
jasmineDone(suiteInfo) {},
|
||||
jasmineStarted(suiteInfo) {},
|
||||
specDone(result) {
|
||||
// Report on the result of individual tests.
|
||||
if (result.status === "excluded") {
|
||||
// Ignore excluded (fit/xit) or skipped (pending) tests.
|
||||
if (["excluded", "pending"].includes(result.status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Report on passed or failed tests.
|
||||
++results.runs;
|
||||
if (result.status === "passed") {
|
||||
console.log(`TEST-PASSED | ${result.description}`);
|
||||
@ -66,10 +68,12 @@ async function runTests(results) {
|
||||
},
|
||||
specStarted(result) {},
|
||||
suiteDone(result) {
|
||||
if (result.status === "excluded") {
|
||||
// Ignore excluded (fdescribe/xdescribe) or skipped (pending) suites.
|
||||
if (["excluded", "pending"].includes(result.status)) {
|
||||
return;
|
||||
}
|
||||
// Report on the result of `afterAll` invocations.
|
||||
|
||||
// Report on failed suites only (indicates problems in setup/teardown).
|
||||
if (result.status === "failed") {
|
||||
++results.failures;
|
||||
console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`);
|
||||
|
||||
@ -62,10 +62,12 @@ const TestReporter = function (browser) {
|
||||
this.specStarted = function (result) {};
|
||||
|
||||
this.specDone = function (result) {
|
||||
if (result.status === "excluded") {
|
||||
// Ignore excluded (fit/xit) or skipped (pending) tests.
|
||||
if (["excluded", "pending"].includes(result.status)) {
|
||||
return;
|
||||
}
|
||||
// Report on the result of individual tests.
|
||||
|
||||
// Report on passed or failed tests.
|
||||
if (result.status === "passed") {
|
||||
sendResult("TEST-PASSED", result.description);
|
||||
} else {
|
||||
@ -78,10 +80,12 @@ const TestReporter = function (browser) {
|
||||
};
|
||||
|
||||
this.suiteDone = function (result) {
|
||||
if (result.status === "excluded") {
|
||||
// Ignore excluded (fdescribe/xdescribe) or skipped (pending) suites.
|
||||
if (["excluded", "pending"].includes(result.status)) {
|
||||
return;
|
||||
}
|
||||
// Report on the result of `afterAll` invocations.
|
||||
|
||||
// Report on failed suites only (indicates problems in setup/teardown).
|
||||
if (result.status === "failed") {
|
||||
let failedMessages = "";
|
||||
for (const item of result.failedExpectations) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user