Jasmine 中是否有等价于的速记:
期望(真).toBe(假)
那么单元测试只要达到这个就可能失败吗?
最佳答案
我抛出错误。我通常在创建尚未实现的新测试函数时执行此操作。
it('should test something when I have implemented it', function() {
throw new Error('Not implemented yet');
});
这让您可以使用任何您想要的解释。
关于javascript - 无条件地使单元测试失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19893772/