Testing your custom filters in AngularJS can be very simple if you keep them straightforward. To illustrate this, consider the following custom filter and test:
myModule.filter('nospace', function() {
return function(text){
return text.replace(' ', ''),
}
});
var nospace = $filter('nospace'),
expect(nospace('my words')).toEqual('mywords'),