我熟悉python unittest测试,如果断言失败,那么测试被标记为"失败",并继续进行其他测试.另一方面,Jasmine将继续通过所有期望,即使其中一个失败.在第一次预期失败后,如何让Jasmine停止处理测试?
it ("shouldn't need to test other expects if the first fails", function() {
expect(array.length).toBe(1);
// don't need to check this if the first failed.
expect(array[0]).toBe("foo");
});
Run Code Online (Sandbox Code Playgroud)
我想错了吗?我有很多测试,expect当只有第一个错误时,显示所有堆栈跟踪似乎是浪费.
jasmine ×1