You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
angular-local-storage/test/spec/test.js

26 lines
733 B
JavaScript

describe('Tests functionality of the localStorage module', function(){
beforeEach(module('LocalStorageModule'));
var ls, store = {};
beforeEach(inject(function(_localStorageService_){
ls = _localStorageService_;
spyOn(ls, 'get').andCallFake(function(key){
return store[key];
});
spyOn(ls, 'set').andCallFake(function(key, val){
return store[key] = val + '';
});
spyOn(ls, 'clearAll').andCallFake(function(){
store = {};
return store;
});
}));
it("Should add a value to my local storage", function(){
ls.set('test', 'MyTest Value');
expect(ls.get('test')).toBe('MyTest Value');
});
});