Stop jasmine test after first expect fails

Jasmine has stop on failure feature and you can check it here: https://plnkr.co/plunk/Ko5m6MQz9VUPMMrC

This starts jasmine with oneFailurePerSpec property.

enter image description here enter image description here enter image description here


Jasmine doesn't support failing early, in a single spec. The idea is to give you all of the failures in case that helps figure out what is really wrong in your spec.


@Gregg's answer was correct for the latest version of Jasmine at that time (v2.0.0).

However, since then, this new feature was added in v2.3.0:

Allow user to stop a specs execution when an expectation fails (Fixes #577)

It's activated by adding throwFailures=true to the query string of the runner page, eg:

http://localhost:8000/?throwFailures=true

Tags:

Jasmine