gpt4 book ai didi

javascript - 为什么我的考试被开 Jest 跳过了

转载 作者:行者123 更新时间:2023-12-05 00:48:22 25 4
gpt4 key购买 nike

我用 jest 进行了这个测试,但是第二种方法被跳过了,为什么?

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('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

最佳答案

简单的错字。去掉测试描述后面的括号,放在测试上关闭}之后。

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

应该是

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

关于javascript - 为什么我的考试被开 Jest 跳过了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51850933/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com