Message:
Error: Timeout - Async callback was not invoked within timeout specified
by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Stack:
Error: Timeout - Async callback was not invoked within timeout
specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
jasmine.DEFAULT_TIMEOUT_INTERVAL
is the period of time in milisecs that Jasmine will wait for a single it
block before throwing a timeout error.
Timeout error can be a sign that something is wrong in your code or that simply it takes more time run. As stated in another answer, you can either increase the global Jasmine timeout interval or, for a single test, set the timeout like this:
const myTestTimeout: number = 2 * 60 * 1000; //explicitly set for readabilty
it('should validate something', (() => { ...your test code }), myTestTimeout);
My approach would be to increase the timeout for that specific test so that you are sure that the test has enough time (e.g. 3 mins). If the test fails again, you can be pretty sure that the cause of the error is an issue in your code.
Increase the jasmin default time interval. You add below code to conf.js file.
Code:
jasmineNodeOpts: {
showColors: true,
includeStackTrace: true,
defaultTimeoutInterval: 1440000
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With