@@ -265,7 +265,7 @@ describe('Box', () => {
265
265
} ) ;
266
266
267
267
it ( 'process() - skip files if they match any of the glob expressions in ignore' , ( ) => {
268
- const box = newBox ( 'test' , { ignore : [ '**/ignore_me' , '**/ignore_me_too' ] } ) ;
268
+ const box = newBox ( 'test' , { ignore : [ '**/ignore_me' , '**/ignore_me_too.txt ' ] } ) ;
269
269
const data = { } ;
270
270
271
271
box . addProcessor ( file => {
@@ -274,7 +274,8 @@ describe('Box', () => {
274
274
275
275
return Promise . all ( [
276
276
fs . writeFile ( pathFn . join ( box . base , 'foo.txt' ) , 'foo' ) ,
277
- fs . writeFile ( pathFn . join ( box . base , 'ignore_me' , 'bar.txt' ) , 'ignore_me' )
277
+ fs . writeFile ( pathFn . join ( box . base , 'ignore_me' , 'bar.txt' ) , 'ignore_me' ) ,
278
+ fs . writeFile ( pathFn . join ( box . base , 'ignore_me_too.txt' ) , 'ignore_me_too' )
278
279
] ) . then ( ( ) => box . process ( ) ) . then ( ( ) => {
279
280
const keys = Object . keys ( data ) ;
280
281
@@ -474,13 +475,16 @@ describe('Box', () => {
474
475
} ) ;
475
476
476
477
it ( 'watch() - update with complex "ignore" option' , ( ) => {
477
- const box = newBox ( 'test' , { ignore : [ '**/ignore_me' , '**/ignore_me_too' ] } ) ;
478
+ const box = newBox ( 'test' , { ignore : [ '**/ignore_me' , '**/ignore_me_too.txt ' ] } ) ;
478
479
const path1 = 'a.txt' ;
479
480
const path2 = 'b.txt' ;
481
+ const path3 = 'ignore_me_too.txt' ;
480
482
const src1 = pathFn . join ( box . base , path1 ) ;
481
483
const src2 = pathFn . join ( box . base , 'ignore_me' , path2 ) ;
484
+ const src3 = pathFn . join ( box . base , path3 ) ;
482
485
const cacheId1 = 'test/' + path1 ;
483
486
const cacheId2 = 'test/ignore_me/' + path2 ;
487
+ const cacheId3 = 'test/' + path3 ;
484
488
const Cache = box . Cache ;
485
489
const processor = sinon . spy ( ) ;
486
490
@@ -493,6 +497,9 @@ describe('Box', () => {
493
497
] ) . then ( ( ) => Promise . all ( [
494
498
fs . writeFile ( src2 , 'b' ) ,
495
499
Cache . insert ( { _id : cacheId2 } )
500
+ ] ) ) . then ( ( ) => Promise . all ( [
501
+ fs . writeFile ( src3 , 'c' ) ,
502
+ Cache . insert ( { _id : cacheId3 } )
496
503
] ) ) . then ( ( ) => box . watch ( ) ) . then ( ( ) => fs . appendFile ( src1 , 'aaa' ) ) . delay ( 500 ) . then ( ( ) => {
497
504
file = processor . lastCall . args [ 0 ] ;
498
505
@@ -503,6 +510,9 @@ describe('Box', () => {
503
510
} ) . then ( ( ) => fs . appendFile ( src2 , 'bbb' ) ) . delay ( 500 ) . then ( ( ) => {
504
511
const file2 = processor . lastCall . args [ 0 ] ;
505
512
file2 . should . eql ( file ) ; // not changed
513
+ } ) . then ( ( ) => fs . appendFile ( src3 , 'ccc' ) ) . delay ( 500 ) . then ( ( ) => {
514
+ const file3 = processor . lastCall . args [ 0 ] ;
515
+ file3 . should . eql ( file ) ; // not changed
506
516
} ) . finally ( ( ) => {
507
517
box . unwatch ( ) ;
508
518
return fs . rmdir ( box . base ) ;
0 commit comments