Message “Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout”

后端 未结 16 1671
[愿得一人]
[愿得一人] 2020-11-28 02:56

I\'m using Puppeteer and Jest to run some front end tests.

My tests look as follows:

describe("Profile Ta         


        
16条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 03:25

    For Jest 24.9+ we just need to add --testTimeout in the command line

    --testTimeout= 10000 // timeout of 10s
    

    The default timeout value is 5000. This will be applicable for all test cases.

    or if you want to give timeout to particular function only then you can use this syntax while declaring the test case.

    test(name, fn, timeout)
    

    example

    test('example', async () => {
      
    
    }, 10000); // timeout of 10s (default is 5000)
    

提交回复
热议问题