Skip to content

Instantly share code, notes, and snippets.

@rolaveric
Last active January 4, 2016 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolaveric/8640024 to your computer and use it in GitHub Desktop.
Save rolaveric/8640024 to your computer and use it in GitHub Desktop.
AngularJS Unit Test: Dependencies, simple
it('Calls anotherService.anotherMethod()', inject(function (myService, anotherService) {
spyOn(anotherService, 'anotherMethod');
myService.myMethod({});
expect(anotherService.anotherMethod).toHaveBeenCalled();
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment