Skip to content

Commit

Permalink
Removed unnecessary check for passedExpectations truthiness
Browse files Browse the repository at this point in the history
specDone events from Jasmine core will always have passedExpectations set to
an array. The console reporter's own tests were the only caller that ever
passed an event without a passedExpectations.
  • Loading branch information
sgravrock committed Feb 15, 2020
1 parent 204e0a1 commit 4814296
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/reporters/console_reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function ConsoleReporter() {
//
// Same logic is used by jasmine.HtmlReporter, see https://github.com/jasmine/jasmine/blob/master/src/html/HtmlReporter.js
if (result.failedExpectations.length === 0 &&
(!result.passedExpectations || result.passedExpectations.length === 0)) {
result.passedExpectations.length === 0) {
printNewline();
print(indent('Message:', 2));
printNewline();
Expand Down
21 changes: 14 additions & 7 deletions spec/reporters/console_reporter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ describe("ConsoleReporter", function() {
actual: true,
stack: fakeStack
}
]
],
passedExpectations: []
});

this.out.clear();
Expand Down Expand Up @@ -255,7 +256,8 @@ describe("ConsoleReporter", function() {
actual: true,
stack: fakeStack
}
]
],
passedExpectations: []
});

this.out.clear();
Expand Down Expand Up @@ -286,7 +288,8 @@ describe("ConsoleReporter", function() {
actual: true,
stack: fakeStack
}
]
],
passedExpectations: []
});

this.out.clear();
Expand Down Expand Up @@ -319,7 +322,8 @@ describe("ConsoleReporter", function() {
actual: true,
stack: undefined
}
]
],
passedExpectations: []
});

this.out.clear();
Expand Down Expand Up @@ -354,7 +358,8 @@ describe("ConsoleReporter", function() {
actual: true,
stack: fakeStack
}
]
],
passedExpectations: []
});

this.out.clear();
Expand Down Expand Up @@ -421,7 +426,8 @@ describe("ConsoleReporter", function() {
status: "failed",
description: "with a failing spec",
fullName: "A suite with a failing spec that has no expectations",
failedExpectations: []
failedExpectations: [],
passedExpectations: []
});

this.out.clear();
Expand Down Expand Up @@ -449,7 +455,8 @@ describe("ConsoleReporter", function() {
expected: false,
actual: true,
stack: undefined
}]
}],
passedExpectations: []
});

this.out.clear();
Expand Down

0 comments on commit 4814296

Please sign in to comment.