自定义单个测试用例的超时消息

时间:2018-12-23 22:21:50

标签: mocha

我有一个测试用例:

describe('test suit', function() {

   it('test case special', async function() {
       // if this one takes longer then the mocha timeout, i want to customize the error message
       const errs = [];
       try {

       } catch(err) {
           errs.push(err);
           await delay(50);
       }
   });

   it('test case regular', function() {

   });

});

我只想为那个特殊测试用例定制超时消息,对于其他测试用例,它应该抛出常规消息。我想扔掉收集的errs的内容。这可能吗?

0 个答案:

没有答案