作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
目前,我们可以通过这种方式使用 pend()
函数给出待定规范的原因 -
xit("pending spec", function(){
//Skipped spec
}).pend("This is a reason");
上述函数的输出将是 -
Sample Test: pending spec
This is a reason
Executed 1 of 1 specs (1 PENDING)
现在,如何获得禁用套件的相同原因?
xdescribe('Disabled suite' , function(){
it('example spec', function(){
//example
});
}).pend("This is a reason");
上述禁用套件的输出是 -
No reason given
即使我使用 pend()
函数也保持不变。谢谢!
最佳答案
挂起消息未在套件中实现,但您可以覆盖 pend
方法,使其在每个规范上写入消息:
jasmine.Suite.prototype.pend = function(message){
this.markedPending = true;
this.children.forEach(spec => spec.pend(message));
};
用法:
xdescribe('Suite', function() {
}).pend("Feature not yet implemented");
Suite.js
的源代码:
https://github.com/jasmine/jasmine/blob/master/src/core/Suite.js#L45
关于javascript - 以任何方式为 Jasmine 中的残疾人套房提供理由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37791690/
在 Rails 中,您可以使用嵌套路由为 has_one 和 has_many 关系创建 RESTful 路由。可以在 Rails Guides 上找到示例 请问有没有什么好的方法可以为habtm关系
我是一名优秀的程序员,十分优秀!