2
votes

I'm working with dockerised NestJS, and am running tests using Jest (ts-jest). One of my tests is exceeding the timeout of 5000 ms and is causing the entire test suite to fail, however the command line output is very generic (see below).

   ● Test suite failed to run
nest-test         |
nest-test         |     Timeout - Async callback was not invoked within the 50000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 50000 ms timeout specified by jest.setTimeout.
nest-test         |
nest-test         |       at mapper (../node_modules/jest-jasmine2/build/queueRunner.js:29:45)

How can I find out which test is causing the error?

Other online answers online suggest to "just increase the timeout", but all of my tests should each run individually within 50 seconds, so I'd prefer to find out which one is failing.

1
It says 50 seconds, not 5, so you could start from a block that has custom timeout.Estus Flask
Ah sorry, you're right - I've edited the post to correct that. However, each test already has a custom timeout of 5000ms (shorter than the Jest timeout of 50000ms), yet they're not being obeyed...Sam Stanford

1 Answers

1
votes

You can add flags: --verbose --runInBand to see the test case failures.

Using --inspect-brk to debug the test case for more detail.