When attempting to test my directive, I encounter a TypeError stating that 'compile is not a function'. Below is the test case I am using:
describe('directive tests', function () {
var element, $compile, scope;
beforeEach(module('App'));
beforeEach(inject(function (_$compile_, $rootScope) {
$compile = _$compile_;
scope = $rootScope.$new();
}));
it('should display Hello', function () {
element = $compile('<div>Hello</div>')(scope);
...
});
});
If I remove the line defining the module (beforeEach(module('App')), the compile works fine, but I am unable to access my directive.