Stop jasmine test after first expect fails

前端 未结 3 947
春和景丽
春和景丽 2020-12-01 21:14

I\'m familiar with python unittest tests where if an assertion fails, that test is marked as \"failed\" and it moves on to other tests. Jasmine on the other hand will contin

3条回答
  •  被撕碎了的回忆
    2020-12-01 21:27

    @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
    

提交回复
热议问题