I am currently working on setting up a test that involves promises. Below is the code snippet for reference:
var promise;
beforeEach(inject(function ($q) {
promise = $q.resolve();
}));
it('should resolve', function (done) {
promise.then(function () {
expect(true).toBeTruthy();
done();
});
});
However, when I try to run this code, it results in a TIMEOUT error.
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
I am puzzled as to why the promise does not execute the callback provided to then
.
Any insights or suggestions would be greatly appreciated!