9
9
. dontMock ( '../docblock' )
10
10
. setMock ( '../../../ModuleDescriptor' , function ( data ) { return data ; } ) ;
11
11
12
- var q = require ( 'q' ) ;
13
-
14
12
describe ( 'DependencyGraph' , function ( ) {
15
13
var DependencyGraph ;
16
14
var fileWatcher ;
@@ -46,7 +44,10 @@ describe('DependencyGraph', function() {
46
44
}
47
45
} ) ;
48
46
49
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
47
+ var dgraph = new DependencyGraph ( {
48
+ roots : [ root ] ,
49
+ fileWatcher : fileWatcher
50
+ } ) ;
50
51
return dgraph . load ( ) . then ( function ( ) {
51
52
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
52
53
. toEqual ( [
@@ -75,7 +76,10 @@ describe('DependencyGraph', function() {
75
76
}
76
77
} ) ;
77
78
78
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
79
+ var dgraph = new DependencyGraph ( {
80
+ roots : [ root ] ,
81
+ fileWatcher : fileWatcher
82
+ } ) ;
79
83
return dgraph . load ( ) . then ( function ( ) {
80
84
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
81
85
. toEqual ( [
@@ -105,7 +109,10 @@ describe('DependencyGraph', function() {
105
109
}
106
110
} ) ;
107
111
108
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
112
+ var dgraph = new DependencyGraph ( {
113
+ roots : [ root ] ,
114
+ fileWatcher : fileWatcher
115
+ } ) ;
109
116
return dgraph . load ( ) . then ( function ( ) {
110
117
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
111
118
. toEqual ( [
@@ -135,7 +142,10 @@ describe('DependencyGraph', function() {
135
142
}
136
143
} ) ;
137
144
138
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
145
+ var dgraph = new DependencyGraph ( {
146
+ roots : [ root ] ,
147
+ fileWatcher : fileWatcher
148
+ } ) ;
139
149
return dgraph . load ( ) . then ( function ( ) {
140
150
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
141
151
. toEqual ( [
@@ -175,7 +185,10 @@ describe('DependencyGraph', function() {
175
185
}
176
186
} ) ;
177
187
178
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
188
+ var dgraph = new DependencyGraph ( {
189
+ roots : [ root ] ,
190
+ fileWatcher : fileWatcher
191
+ } ) ;
179
192
return dgraph . load ( ) . then ( function ( ) {
180
193
expect ( dgraph . getOrderedDependencies ( '/root/somedir/somefile.js' ) )
181
194
. toEqual ( [
@@ -216,7 +229,10 @@ describe('DependencyGraph', function() {
216
229
}
217
230
} ) ;
218
231
219
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
232
+ var dgraph = new DependencyGraph ( {
233
+ roots : [ root ] ,
234
+ fileWatcher : fileWatcher
235
+ } ) ;
220
236
return dgraph . load ( ) . then ( function ( ) {
221
237
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
222
238
. toEqual ( [
@@ -245,7 +261,10 @@ describe('DependencyGraph', function() {
245
261
}
246
262
} ) ;
247
263
248
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
264
+ var dgraph = new DependencyGraph ( {
265
+ roots : [ root ] ,
266
+ fileWatcher : fileWatcher
267
+ } ) ;
249
268
return dgraph . load ( ) . then ( function ( ) {
250
269
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
251
270
. toEqual ( [
@@ -280,7 +299,10 @@ describe('DependencyGraph', function() {
280
299
}
281
300
} ) ;
282
301
283
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
302
+ var dgraph = new DependencyGraph ( {
303
+ roots : [ root ] ,
304
+ fileWatcher : fileWatcher
305
+ } ) ;
284
306
return dgraph . load ( ) . then ( function ( ) {
285
307
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
286
308
. toEqual ( [
@@ -320,7 +342,10 @@ describe('DependencyGraph', function() {
320
342
}
321
343
} ) ;
322
344
323
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
345
+ var dgraph = new DependencyGraph ( {
346
+ roots : [ root ] ,
347
+ fileWatcher : fileWatcher
348
+ } ) ;
324
349
return dgraph . load ( ) . then ( function ( ) {
325
350
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
326
351
. toEqual ( [
@@ -360,7 +385,10 @@ describe('DependencyGraph', function() {
360
385
}
361
386
} ) ;
362
387
363
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
388
+ var dgraph = new DependencyGraph ( {
389
+ roots : [ root ] ,
390
+ fileWatcher : fileWatcher
391
+ } ) ;
364
392
return dgraph . load ( ) . then ( function ( ) {
365
393
expect ( dgraph . getOrderedDependencies ( '/root/index.js' ) )
366
394
. toEqual ( [
@@ -386,7 +414,6 @@ describe('DependencyGraph', function() {
386
414
} ) ;
387
415
388
416
describe ( 'file watch updating' , function ( ) {
389
- var fileWatcher ;
390
417
var triggerFileChange ;
391
418
392
419
beforeEach ( function ( ) {
@@ -428,7 +455,10 @@ describe('DependencyGraph', function() {
428
455
}
429
456
} ) ;
430
457
431
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
458
+ var dgraph = new DependencyGraph ( {
459
+ roots : [ root ] ,
460
+ fileWatcher : fileWatcher
461
+ } ) ;
432
462
return dgraph . load ( ) . then ( function ( ) {
433
463
filesystem . root [ 'index.js' ] =
434
464
filesystem . root [ 'index.js' ] . replace ( 'require("foo")' , '' ) ;
@@ -476,7 +506,10 @@ describe('DependencyGraph', function() {
476
506
}
477
507
} ) ;
478
508
479
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
509
+ var dgraph = new DependencyGraph ( {
510
+ roots : [ root ] ,
511
+ fileWatcher : fileWatcher
512
+ } ) ;
480
513
return dgraph . load ( ) . then ( function ( ) {
481
514
filesystem . root [ 'index.js' ] =
482
515
filesystem . root [ 'index.js' ] . replace ( 'require("foo")' , '' ) ;
@@ -524,7 +557,10 @@ describe('DependencyGraph', function() {
524
557
}
525
558
} ) ;
526
559
527
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
560
+ var dgraph = new DependencyGraph ( {
561
+ roots : [ root ] ,
562
+ fileWatcher : fileWatcher
563
+ } ) ;
528
564
return dgraph . load ( ) . then ( function ( ) {
529
565
delete filesystem . root . foo ;
530
566
triggerFileChange ( 'delete' , 'foo.js' , root ) ;
@@ -571,7 +607,10 @@ describe('DependencyGraph', function() {
571
607
}
572
608
} ) ;
573
609
574
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
610
+ var dgraph = new DependencyGraph ( {
611
+ roots : [ root ] ,
612
+ fileWatcher : fileWatcher
613
+ } ) ;
575
614
return dgraph . load ( ) . then ( function ( ) {
576
615
filesystem . root [ 'bar.js' ] = [
577
616
'/**' ,
@@ -679,7 +718,7 @@ describe('DependencyGraph', function() {
679
718
680
719
pit ( 'should ignore directory updates' , function ( ) {
681
720
var root = '/root' ;
682
- var filesystem = fs . __setMockFilesystem ( {
721
+ fs . __setMockFilesystem ( {
683
722
'root' : {
684
723
'index.js' : [
685
724
'/**' ,
@@ -703,7 +742,10 @@ describe('DependencyGraph', function() {
703
742
}
704
743
}
705
744
} ) ;
706
- var dgraph = new DependencyGraph ( { roots : [ root ] , fileWatcher : fileWatcher } ) ;
745
+ var dgraph = new DependencyGraph ( {
746
+ roots : [ root ] ,
747
+ fileWatcher : fileWatcher
748
+ } ) ;
707
749
return dgraph . load ( ) . then ( function ( ) {
708
750
triggerFileChange ( 'change' , 'aPackage' , '/root' , {
709
751
isDirectory : function ( ) { return true ; }
0 commit comments