- ( , ), , @MBielski , ! , , unit test, .
:
angular.module('prismApp.filters', [])
.filter('billShip', function () {
return function (userData) {
...
}
});
:
describe("Unit Testing: Filters - ", function() {
var billShip;
beforeEach(module('prismApp.filters'));
beforeEach(inject(function ($filter) {
billShip = $filter('billShip');
}));
it('should have a bill-ship filter: ', function () {
expect(billShip).not.toEqual(null);
expect(billShip("0")).toEqual("Billing");
...
});
});
, .