mercredi 27 janvier 2016

How to unit-test an AngularJS service that uses localStorage internally

How do I unit-test a factory that uses $window.localStorage internally using Jasmine and ngMock?

Here's something similar to what I have:

myApp.factory('myData',function ($window) {
    return { 
        message: $window.localStorage['stuff'] 
    }
});

Thanks a bunch!

Aucun commentaire:

Enregistrer un commentaire