File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ There are 2 ways to create collections & they can be used together:
98
98
},
99
99
pattern: ' news/**/*.html' ,
100
100
sortBy: ' pubdate' ,
101
- reverse: true ,
101
+ reverse: true
102
102
},
103
103
services: ' services/**/*.html'
104
104
})
Original file line number Diff line number Diff line change @@ -388,4 +388,26 @@ describe('@metalsmith/collections', function () {
388
388
done ( )
389
389
} )
390
390
} )
391
+
392
+ it ( 'should not add duplicates on repeat builds' , function ( done ) {
393
+ const metalsmith = Metalsmith ( 'test/fixtures/noconfig' ) . use ( collections ( ) )
394
+
395
+ Promise . all ( [
396
+ new Promise ( ( resolve , reject ) => {
397
+ metalsmith . process ( ( err ) => {
398
+ if ( err ) reject ( err )
399
+ resolve ( metalsmith . metadata ( ) . collections )
400
+ } )
401
+ } ) ,
402
+ new Promise ( ( resolve , reject ) => {
403
+ metalsmith . process ( ( err ) => {
404
+ if ( err ) reject ( err )
405
+ resolve ( metalsmith . metadata ( ) . collections )
406
+ } )
407
+ } )
408
+ ] ) . then ( ( results ) => {
409
+ assert . deepStrictEqual ( results [ 0 ] , results [ 1 ] )
410
+ done ( )
411
+ } )
412
+ } )
391
413
} )
You can’t perform that action at this time.
0 commit comments