I've tried all the solutions in this answer but none of them work for me.
I'm using jasmine v2.3.2
and jasmine-core v2.3.4
When I do this test:
jasmine.DEFAULT_TIMEOUT_INTERVAL= 999999;
describe('tests content controller', function(){
//...
fit('/content should return 200',function(done){
request(app)
.get('/content?type=script')
.set('Authorization', "bearer " + requestor.token)
.set('Accept', 'application/json')
.expect(200)
.end(function (err, res) {
if (err) done.fail(err);
expect(res.statusCode).toBe(200);
console.log('got here');
console.log(jasmine.DEFAULT_TIMEOUT_INTERVAL); //prints 30000
done();
})
},999999);
I see on my console that the request took only 3000 milliseconds. I even see my got here
log.
The log that shows the timeout prints out 30000
and not 999999
like I expect.
I also get a failure for this test with the message:
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 Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
1 spec, 1 failure
Finished in 33.069 seconds
There is some initial setup which causes the majority of this ~30 second delay. The application has to connect to several databases and run the beforeAll
function in the describe
.
How can I get prevent jasmine from timing out like this?