Skip to content

Commit 8a22faa

Browse files
committed
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.
1 parent caa55b1 commit 8a22faa

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

test/integration/jasmine-boot.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ async function runTests(results) {
5252
jasmineDone(suiteInfo) {},
5353
jasmineStarted(suiteInfo) {},
5454
specDone(result) {
55-
// Report on the result of individual tests.
56-
if (result.status === "excluded") {
55+
// Ignore excluded (fit/xit) or skipped (pending) tests.
56+
if (["excluded", "pending"].includes(result.status)) {
5757
return;
5858
}
59+
60+
// Report on passed or failed tests.
5961
++results.runs;
6062
if (result.status === "passed") {
6163
console.log(`TEST-PASSED | ${result.description}`);
@@ -66,10 +68,12 @@ async function runTests(results) {
6668
},
6769
specStarted(result) {},
6870
suiteDone(result) {
69-
if (result.status === "excluded") {
71+
// Ignore excluded (fdescribe/xdescribe) or skipped (pending) suites.
72+
if (["excluded", "pending"].includes(result.status)) {
7073
return;
7174
}
72-
// Report on the result of `afterAll` invocations.
75+
76+
// Report on failed suites only (indicates problems in setup/teardown).
7377
if (result.status === "failed") {
7478
++results.failures;
7579
console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`);

test/reporter.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ const TestReporter = function (browser) {
6262
this.specStarted = function (result) {};
6363

6464
this.specDone = function (result) {
65-
if (result.status === "excluded") {
65+
// Ignore excluded (fit/xit) or skipped (pending) tests.
66+
if (["excluded", "pending"].includes(result.status)) {
6667
return;
6768
}
68-
// Report on the result of individual tests.
69+
70+
// Report on passed or failed tests.
6971
if (result.status === "passed") {
7072
sendResult("TEST-PASSED", result.description);
7173
} else {
@@ -78,10 +80,12 @@ const TestReporter = function (browser) {
7880
};
7981

8082
this.suiteDone = function (result) {
81-
if (result.status === "excluded") {
83+
// Ignore excluded (fdescribe/xdescribe) or skipped (pending) suites.
84+
if (["excluded", "pending"].includes(result.status)) {
8285
return;
8386
}
84-
// Report on the result of `afterAll` invocations.
87+
88+
// Report on failed suites only (indicates problems in setup/teardown).
8589
if (result.status === "failed") {
8690
let failedMessages = "";
8791
for (const item of result.failedExpectations) {

0 commit comments

Comments
 (0)