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
As per the screenshot above, the setItem call returns an ES6 promise instead of an angular promise. This is usually not a problem, unless you plan to use the finally call on the promise, in which case you get an error.
For the sake of consistency, we should wrap the ES6 promise inside an angular promise like so:
After delving further, it turns out a number of modern browsers actually support the finally call as per the latest ECMAScript draft, so it's not always possible to distinguish between angular promises and native promises in unit tests through the finally call.
As per the screenshot above, the setItem call returns an ES6 promise instead of an angular promise. This is usually not a problem, unless you plan to use the
finally
call on the promise, in which case you get an error.For the sake of consistency, we should wrap the ES6 promise inside an angular promise like so:
The text was updated successfully, but these errors were encountered: