I want to check a directive that has a filter dependency. I would like to introduce the actual filter, and not use the layout.
Here is my mockery beforeEach. How do I start typing the actual ones filter? I tried to inject as part inject function, but this does not seem to work.
beforeEach(function() {
someFilterMock = function(value) {
return value;
};
module('app');
module('templates');
module(function($provide) {
$provide.value('someFilterFilter', someFilterMock);
});
inject(function($rootScope, $compile) {
scope = $rootScope.$new();
element = angular.element('<this-is-directive />');
$compile(element)(scope);
scope.$digest();
});
});
source
share