Skip to content

Instantly share code, notes, and snippets.

@LoganBarnett
Last active September 21, 2015 05:00
Show Gist options
  • Save LoganBarnett/5c443053d6cff7e79b56 to your computer and use it in GitHub Desktop.
Save LoganBarnett/5c443053d6cff7e79b56 to your computer and use it in GitHub Desktop.
describe('my category', function() {
beforeEach(module('LocalForageModule'));
it('does stuff', function() {
inject(function($localForage) {
// test stuff goes here
});
});
});
describe('elaborate test', function() {
// note we don't even include the local forage module anymore.
beforeEach(function() {
module('my_app.module', function($provide) {
var localForageMock = {
foo: jasmine.createSpy('foo')
};
$provide.value('$localForage', localForageMock);
});
});
it('does stuff', function() {
inject(function($localForage) {
doStuff();
expect($localForage.foo).toHaveBeenCalled();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment