Since the executed_specs property is incremented via a call to specDone (from jasmine.js) when a spec is run, the value of failed will be non-zero if any specs had a status not equal to passed. The code in jasmine-runner.js, however, passes PhantomJS a status code of 1 only if one or more specs have been marked as failed. This combination causes the test suite to pass (from a status code perspective) while the ConsoleReporter displays a failure message.
This patch introduces a new status skipped_or_pending and corresponding counter that is incremented when specDone is called and the spec has not been marked as a success or failure. The value of failed consumes the value of this counter. The final message displayed to the user now communicates if any tests were pending or skipped.
Problem
The
reportRunnerResults
method on theConsoleReporter
computes the total number of failed specs thusly:Since the
executed_specs
property is incremented via a call tospecDone
(from jasmine.js) when a spec is run, the value offailed
will be non-zero if any specs had a status not equal topassed
. The code in jasmine-runner.js, however, passes PhantomJS a status code of 1 only if one or more specs have been marked asfailed
. This combination causes the test suite to pass (from a status code perspective) while the ConsoleReporter displays a failure message.Solution
This patch introduces a new status
skipped_or_pending
and corresponding counter that is incremented whenspecDone
is called and the spec has not been marked as a success or failure. The value offailed
consumes the value of this counter. The final message displayed to the user now communicates if any tests werepending
orskipped
.