Use a mock clock in Jasmine
Jasmine (1.3, in this case) allows you to mock the clock:
beforeEach(() => {
jasmine.Clock.useMock();
});
it('should do awesome stuff', () => {
var awesome = false;
setTimeout(() => {
awesome = true;
},
60000);
expect(awesome).toEqual(false);
jasmine.Clock.tick(60000);
expect(awesome).toEqual(true);
});
Of course, this test won’t run for 60 seconds. For this reason, using mock clock should be preferred over setting timeouts with expectations.