在通过“运动”进行的练习中,测试以“ xit”而不是“ it”来进行。这样开玩笑就不会运行这些测试。
有什么方法可以强制所有测试运行,而不必将“ xit”更改为“ it”?
describe('A leap year', () => {
it('is not very common', () => {
expect(isLeapYear(2015)).toBeFalsy()
})
xit('is introduced every 4 years to adjust about a day', () => {
expect(isLeapYear(2016)).toBeTruthy()
})
})
答案 0 :(得分:-1)
您可以在描述之前将'xit'变量定义为'it'
var xit = it;
describe('A leap year', () => {
xit('is not very common', () => {
expect(isLeapYear(2015)).toBeFalsy()
})
xit('is introduced every 4 years to adjust about a day', () => {
expect(isLeapYear(2016)).toBeTruthy()
})
})