以任何方式为茉莉花中的残疾人套房提供理由
Any way to provide reason to a disabled suite in Jasmine
目前,我们可以通过这种方式使用 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
目前,我们可以通过这种方式使用 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