Created
September 1, 2014 12:55
-
-
Save gregberge/4b582699deab5a4dfb9c to your computer and use it in GitHub Desktop.
Angular directive test using mocha.
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
describe('My directive', function () { | |
var scope, $compile; | |
beforeEach(module('app.directives')); | |
beforeEach(inject(function ($injector) { | |
$compile = $injector.get('$compile'); | |
var $rootScope = $injector.get('$rootScope'); | |
scope = $rootScope.$new(); | |
})); | |
afterEach(function () { | |
scope.$destroy(); | |
}); | |
it('should do something', function () { | |
$compile('<my-directive></my-directive>')(scope); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment