Last active
December 16, 2015 19:00
-
-
Save oliverm2112/5482098 to your computer and use it in GitHub Desktop.
Test suite
This file contains 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
'use strict'; | |
describe('Unit: Testing app', function () { | |
var enterprise, | |
enterprise2, | |
deps, | |
hasModule = function (m) { | |
return deps.indexOf(m) >= 0; | |
}; | |
beforeEach(function () { | |
enterprise = angular.module('enterprise'); | |
angular.mock.module('enterprise'); | |
deps = enterprise.value('enterprise').requires; | |
}); | |
it('should be registered', function () { | |
expect(enterprise).toBeDefined(); | |
expect(enterprise).toEqual(jasmine.any(Object)); | |
expect(enterprise.name).toEqual('enterprise'); | |
}); | |
it('should have ui.bootstrap as a dependency', function () { | |
expect(hasModule('ui.bootstrap')).toBe(true); | |
}); | |
it('should have ngGrid as a dependency', function () { | |
expect(hasModule('ngGrid')).toBe(true); | |
}); | |
it('should have a reverse filter', inject(function ($filter) { | |
expect($filter('reverse')('fred')).toEqual('derf'); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment