为什么我的测试开玩笑地被跳过

时间:2018-08-14 23:17:45

标签: javascript jestjs

我使用笑话进行了此测试,但是第二种方法却被跳过了,为什么?

const stringToTest = JSON.stringify({"filename":"9F6148567F8.jpg","id":"ss9:blob-ref:29e4b813a","diskp":"gotchi","mikoId":"e3f813a","content":"gotchi, 18/08/13 at 11:57 AM"});

describe('regex for uri',()=> {

it('should match expected URI', () => {
    expect(matchUriRE.test(stringToTest)).toBe(true);
});

//below method skipped why?
it('should not be bull or undefined'), () => {
    expect(matchUriRE.test(stringToTest)).not.toBeNull;
    expect(matchUriRE.test(stringToTest)).not.toBe(null);
    expect(matchUriRE.test(stringToTest)).not.toBeUndefined();
};
}) 

结果:

Test Suites: 1 passed, 1 total
Tests:       1 skipped, 1 passed, 2 total

1 个答案:

答案 0 :(得分:2)

简单的错字。在测试描述后删除括号,并在测试上关闭}后将其放置。

it('should not be bull or undefined'), () => {

应该是

it('should not be bull or undefined', () => {