The filter can be entered directly into the test (found a fragment here )
describe('myApp', function () { beforeEach(function () { module('myApp'); }); it('has a bool filter', inject(function($filter) { expect($filter('bool')).not.toBeNull(); })); it("should return true empty array ", inject(function (boolFilter) { expect(boolFilter(true)).toBeTruthy(); })); });
In this example, the filter name is "bool", to enter this filter, you must use 'bool' + 'Filter' = 'boolFilter'
Valeriy Nov 14 '14 at 7:43 2014-11-14 07:43
source share