简体   繁体   English

无条件地失败单元测试

[英]Unconditionally fail unit test

Is there a shorthand in jasmine equivalent to: 是否有茉莉花的简写相当于:

expect(true).toBe(false)

So the unit test can fail whenever it reaches this? 那么单元测试到达时会失败吗?

I throw errors. 我抛出错误。 I usually do this when I have created new test functions that are not implemented yet. 我通常在创建尚未实现的新测试函数时执行此操作。

it('should test something when I have implemented it', function() {
    throw new Error('Not implemented yet');
});

This lets you use any explanation you want. 这使您可以使用任何想要的解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 模拟功能是未定义的,但是单元测试不会失败 - Mocked function is `undefined` but unit test doesn't fail 使用组件的@ViewChild {阅读:ElementRef}导致单元测试失败 - Using @ViewChild { read: ElementRef } of component causes unit test to fail 为什么此单元测试失败? (Jasmine / AngularJS的承诺) - Why does this unit test fail? (Promises with Jasmine/AngularJS) 如何在Promise承诺的范围内使Node单元测试失败? - How do I fail a Node unit test on the catch of a Promise? 猫鼬模型单元测试-如果任何测试用例失败,连接将不会关闭 - Mongoose model unit testing - Connection wont close if any test cases fail Javascript单元测试依赖项-当依赖对象发生更改时如何使测试失败 - Javascript Unit testing dependencies - How to make a test fail when a depended object changes 当单元测试有解析错误时,为什么我的业力测试不会失败? - Why don't my karma tests fail when the unit test has a parse error? QUnit,Sinon.js和Backbone单元测试失败:sinon间谍似乎未能检测到Backbone Model事件回调 - QUnit, Sinon.js & Backbone unit test frustration: sinon spy appears to fail to detect Backbone Model event callbacks 摩卡不失败测试 - Mocha not fail test 量角器:随机测试失败 - protractor: random test fail
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM