我有一些不应运行的单元测试,到目前为止,有什么方法可以跳过它们吗?除了在我要运行的程序上使用fdescribe。
答案 0 :(得分:4)
如果您想跳过测试,则在describe()或it()前面是'x':
xdescribe('some test', () => { });
也许只是跳过一个测试块:
describe('some other test', () => {
xit('skip this test', () => { });
});
答案 1 :(得分:0)
如果您要基于某种条件在运行时跳过整个测试套件,可以执行以下操作:
(yourCondition ? xdescribe : describe)('My Test Suite', function () {
...
})
答案 2 :(得分:-1)
您可以使用f
(it
)前面的fit
跳过特定测试