@@ -334,6 +334,32 @@ describe('DiffPatcher', function() {
334334
335335 } ) ;
336336
337+ describe ( 'removing and replacing pipe filters' , function ( ) {
338+ it ( 'removes specified filter' , function ( ) {
339+ expect ( this . instance . processor . pipes . diff . list ( ) ) . to . be . deepEqual ( [
340+ 'collectChildren' , 'numeric' , 'trivial' , 'dates' , 'texts' , 'objects' , 'arrays'
341+ ] ) ;
342+ this . instance . processor . pipes . diff . remove ( 'dates' ) ;
343+ expect ( this . instance . processor . pipes . diff . list ( ) ) . to . be . deepEqual ( [
344+ 'collectChildren' , 'numeric' , 'trivial' , 'texts' , 'objects' , 'arrays'
345+ ] ) ;
346+ } ) ;
347+
348+ it ( 'replaces specified filter' , function ( ) {
349+ function fooFilter ( context ) {
350+ context . setResult ( [ 'foo' ] ) . exit ( ) ;
351+ }
352+ fooFilter . filterName = 'foo' ;
353+ expect ( this . instance . processor . pipes . diff . list ( ) ) . to . be . deepEqual ( [
354+ 'collectChildren' , 'numeric' , 'trivial' , 'texts' , 'objects' , 'arrays'
355+ ] ) ;
356+ this . instance . processor . pipes . diff . replace ( 'trivial' , fooFilter ) ;
357+ expect ( this . instance . processor . pipes . diff . list ( ) ) . to . be . deepEqual ( [
358+ 'collectChildren' , 'numeric' , 'foo' , 'texts' , 'objects' , 'arrays'
359+ ] ) ;
360+ } ) ;
361+ } ) ;
362+
337363 } ) ;
338364
339365 describe ( 'formatters' , function ( ) {
0 commit comments