How to increase timeout for a single test case in mocha

前端 未结 8 1889
走了就别回头了
走了就别回头了 2020-11-28 01:59

I\'m submitting a network request in a test case, but this sometimes takes longer than 2 seconds (the default timeout).

How do I increase the timeout for a single te

8条回答
  •  天涯浪人
    2020-11-28 03:02

    If you are using in NodeJS then you can set timeout in package.json

    "test": "mocha --timeout 10000"
    

    then you can run using npm like:

    npm test
    

提交回复
热议问题