If response.on('end'... contains an expect()... statement that fails. The error is caught in the catch function within the request function and causes the async test to timeout rather than give correct error.
Test fails with following error:
Timeout - Async callback was not invoked within the 3000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 3000ms timeout specified by jest.setTimeout.Error:
If
response.on('end'...
contains anexpect()...
statement that fails. The error is caught in the catch function within the request function and causes the async test to timeout rather than give correct error.Test fails with following error:
Timeout - Async callback was not invoked within the 3000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 3000ms timeout specified by jest.setTimeout.Error: