You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expect(getUser()).toBeUndefined();loadUser();//function that invokes Query.findexpect(getUser()).toBeDefined();expect(stub.callCount).toEqual(1);//do assertions on stub object if necessary
Sorry, I'm relatively new to Javascript Async unit testing. It's always useful to have these things spelled out for newbies ;).
The text was updated successfully, but these errors were encountered:
Absolutely, I will update the examples. Meanwhile, if need to test a function that returns a promise, then you should chain to that promise:
loadUser().then(function () { //load user returns a promise
expect(getUser()).toBeDefined();
expect(stub.callCount).toEqual(1); //do assertions on stub object if necessary
});
The example given in the README:
Sorry, I'm relatively new to Javascript Async unit testing. It's always useful to have these things spelled out for newbies ;).
The text was updated successfully, but these errors were encountered: