Skip to content

Instantly share code, notes, and snippets.

@oliverm2112
Last active December 16, 2015 19:00
Show Gist options
  • Save oliverm2112/5482098 to your computer and use it in GitHub Desktop.
Save oliverm2112/5482098 to your computer and use it in GitHub Desktop.
Test suite
'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