【发布时间】:2020-10-15 17:06:07
【问题描述】:
我正在尝试增加描述块内的某些测试用例的开玩笑超时。
我发现this stackoverflow 问题在哪里他们建议在test(name, fn) 中使用jest.setTimeOut(10000) 来增加该测试用例的超时时间。
test('descriptinon', async () => {
jest.setTimeOut(10000);
...
})
如果我想增加描述块内所有测试的超时时间,我可以在描述块内添加jest.testTimeOut,如下所示?
describe('description', () => {
jest.setTimeOut(10000);
test('test description', async () => {
...
});
test('test description', async () => {
...
});
});
是只增加 describe 块内测试用例的超时时间还是全局增加超时时间?
【问题讨论】:
标签: javascript jestjs automated-tests