mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-10 23:34:02 +02:00
Use the status property of Jasmine's result object in the custom reporters
This improves readability of the code and makes it consistent with the recently added check for excluded tests.
This commit is contained in:
parent
9c21d7016b
commit
8a5f6f5157
@ -57,7 +57,7 @@ async function runTests(results) {
|
||||
return;
|
||||
}
|
||||
++results.runs;
|
||||
if (result.failedExpectations.length === 0) {
|
||||
if (result.status === "passed") {
|
||||
console.log(`TEST-PASSED | ${result.description}`);
|
||||
} else {
|
||||
++results.failures;
|
||||
@ -70,7 +70,7 @@ async function runTests(results) {
|
||||
return;
|
||||
}
|
||||
// Report on the result of `afterAll` invocations.
|
||||
if (result.failedExpectations.length > 0) {
|
||||
if (result.status === "failed") {
|
||||
++results.failures;
|
||||
console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`);
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ const TestReporter = function (browser) {
|
||||
return;
|
||||
}
|
||||
// Report on the result of individual tests.
|
||||
if (result.failedExpectations.length === 0) {
|
||||
if (result.status === "passed") {
|
||||
sendResult("TEST-PASSED", result.description);
|
||||
} else {
|
||||
let failedMessages = "";
|
||||
@ -82,7 +82,7 @@ const TestReporter = function (browser) {
|
||||
return;
|
||||
}
|
||||
// Report on the result of `afterAll` invocations.
|
||||
if (result.failedExpectations.length > 0) {
|
||||
if (result.status === "failed") {
|
||||
let failedMessages = "";
|
||||
for (const item of result.failedExpectations) {
|
||||
failedMessages += `${item.message} `;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user