Skip to content

Commit

Permalink
Add a test case for undefined stack
Browse files Browse the repository at this point in the history
  • Loading branch information
ybian committed Jul 28, 2016
1 parent 9b5df8b commit 6de5013
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions spec/reporters/console_reporter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,36 @@ describe("ConsoleReporter", function() {
expect(this.out.getOutput()).not.toMatch(jasmineCorePath);
});

it("reports a summary when done in case that stack is somehow undefined", function() {
var reporter = new ConsoleReporter({
print: this.out.print,
jasmineCorePath: jasmineCorePath
});

reporter.jasmineStarted();
reporter.specDone({status: "passed"});
reporter.specDone({
status: "failed",
description: "with a failing spec",
fullName: "A suite with a failing spec",
failedExpectations: [
{
passed: false,
message: "Expected true to be false.",
expected: false,
actual: true,
stack: undefined
}
]
});

this.out.clear();

reporter.jasmineDone();

expect(this.out.getOutput()).toMatch(/true to be false/);
});

it("reports a summary when done that includes custom filtered stack traces for a failing suite", function() {
var stackLine = 'custom line of stack';
var customStackFilter = function(stack) {
Expand Down

0 comments on commit 6de5013

Please sign in to comment.