I am trying to write get the test working that has nested promises. For some reason the promise is never returning.
For example
describe('Some tests', function ()
{
it("Should complete the test with the nested promises", function(done)
{
inject(function (SomeService, $rootScope)
{
SomeService.somePromise().then(function(err)
{
console.log("Message 1");
expect(err).toBeNull();
SomeService.someOtherPromise.then(function(res)
{
console.log("Message 2");
// Check some data
done();
});
});
$rootScope.$digest();
});
});
});The strange thing is, if this test is run by its self it passes. But if there is more than one of these tests it fails.
When the test fails it seems as though the first promise is never returned. So we don't even see the first console message. My question is how to get this kind of test running and why is it not working correctly.
--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js+...@googlegroups.com.
To post to this group, send email to jasmi...@googlegroups.com.
Visit this group at http://groups.google.com/group/jasmine-js.
For more options, visit https://groups.google.com/d/optout.
Visit this group at https://groups.google.com/group/jasmine-js.