@@ -79,11 +79,14 @@ test('more complicated dependencies', function (t) {
79
79
} ) ) ;
80
80
bundle . pipe ( packs [ name ] ) ;
81
81
} ) ;
82
- mdeps ( files ) . pipe ( fr )
82
+ var md = mdeps ( ) ;
83
+ md . pipe ( fr )
83
84
fr . pipe ( rowsOf ( function ( rows ) {
84
85
t . deepEqual ( rows , expected . common ) ;
85
86
} ) ) ;
86
87
fr . pipe ( packs . common ) ;
88
+ files . forEach ( function ( file ) { md . write ( { file : file } ) } ) ;
89
+ md . end ( ) ;
87
90
} ) ;
88
91
89
92
test ( 'same module included twice' , function ( t ) {
@@ -143,11 +146,14 @@ test('same module included twice', function (t) {
143
146
} ) ) ;
144
147
bundle . pipe ( packs [ name ] ) ;
145
148
} ) ;
146
- mdeps ( files ) . pipe ( fr )
149
+ var md = mdeps ( ) ;
150
+ md . pipe ( fr )
147
151
fr . pipe ( rowsOf ( function ( rows ) {
148
152
t . deepEqual ( rows , expected . common ) ;
149
153
} ) ) ;
150
154
fr . pipe ( packs . common ) ;
155
+ files . forEach ( function ( file ) { md . write ( { file : file } ) } ) ;
156
+ md . end ( ) ;
151
157
} ) ;
152
158
153
159
test ( 'threshold function reorganizes bundles' , function ( t ) {
@@ -233,11 +239,14 @@ test('threshold function reorganizes bundles', function (t) {
233
239
} ) ) ;
234
240
bundle . pipe ( packs [ name ] ) ;
235
241
} ) ;
236
- mdeps ( files ) . pipe ( fr )
242
+ var md = mdeps ( ) ;
243
+ md . pipe ( fr )
237
244
fr . pipe ( rowsOf ( function ( rows ) {
238
245
t . deepEqual ( rows , expected . common ) ;
239
246
} ) ) ;
240
247
fr . pipe ( packs . common ) ;
248
+ files . forEach ( function ( file ) { md . write ( { file : file } ) } ) ;
249
+ md . end ( ) ;
241
250
} ) ;
242
251
243
252
test ( 'if dependent is in common, so is dependee' , function ( t ) {
@@ -301,11 +310,14 @@ test('if dependent is in common, so is dependee', function (t) {
301
310
} ) ) ;
302
311
bundle . pipe ( packs [ name ] ) ;
303
312
} ) ;
304
- mdeps ( files ) . pipe ( fr )
313
+ var md = mdeps ( ) ;
314
+ md . pipe ( fr )
305
315
fr . pipe ( rowsOf ( function ( rows ) {
306
316
t . deepEqual ( rows , expected . common ) ;
307
317
} ) ) ;
308
318
fr . pipe ( packs . common ) ;
319
+ files . forEach ( function ( file ) { md . write ( { file : file } ) } ) ;
320
+ md . end ( ) ;
309
321
} ) ;
310
322
311
323
function rowsOf ( cb ) {
@@ -326,6 +338,7 @@ function read (name, ref) {
326
338
if ( ! ref ) ref = { } ;
327
339
var file = norm ( name ) ;
328
340
ref . id = file ;
341
+ ref . file = file ;
329
342
ref . source = fs . readFileSync ( file , 'utf8' ) ;
330
343
if ( ! ref . deps ) ref . deps = { } ;
331
344
return ref ;
0 commit comments