Created
February 5, 2018 19:22
-
-
Save ldmarz/fb60fc4fe0cc3b81b79f5624f02ecc05 to your computer and use it in GitHub Desktop.
Unit testing service in angularjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const module = angular.mock.module; | |
const inject = angular.mock.inject; | |
let searchService; | |
describe('Testing some awesome service', () => { | |
beforeAll(module('yourModule')); | |
beforeEach(inject($injector => { | |
searchService = $injector.get('SearchClass'); | |
})); | |
it('Should be defined', () => { | |
expect(searchService).toBeDefined(); | |
}); | |
)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment