最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - what is slow parameter in mocha? - Stack Overflow

programmeradmin8浏览0评论

When we define mochaOpts in Protractor, we define one parameter as slow. I do not understand what is the use of that parameter. I tried changing it's value but I can't see any change in test execution time.

mochaOpts: {
   reporter: 'spec',
   slow: 1000,
}

When we define mochaOpts in Protractor, we define one parameter as slow. I do not understand what is the use of that parameter. I tried changing it's value but I can't see any change in test execution time.

mochaOpts: {
   reporter: 'spec',
   slow: 1000,
}
Share Improve this question edited Jan 1, 2017 at 4:26 Cœur 38.7k26 gold badges202 silver badges277 bronze badges asked Oct 14, 2015 at 6:21 PriyanshuPriyanshu 3,0583 gold badges29 silver badges34 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 20

According to the documentation its used for testing

-s, --slow

Specify the "slow" test threshold, defaulting to 75ms. Mocha uses this to highlight test-cases that are taking too long.

To tweak what's considered "slow", you can use the slow() method:

describe('something slow', function() {
  this.slow(10000);

  it('should take long enough for me to go make a sandwich', function() {
    // ...
  });
});
发布评论

评论列表(0)

  1. 暂无评论