有没有一种方法可以跳过Angular中的单元测试套件?

时间:2018-09-26 09:19:46

标签: angular angular6

我有一些不应运行的单元测试,到目前为止,有什么方法可以跳过它们吗?除了在我要运行的程序上使用fdescribe。

3 个答案:

答案 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)

您可以使用fit)前面的fit跳过特定测试