File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ // Check that spawn child doesn't create duplicated entries
4+ require ( '../common' ) ;
35const REPETITIONS = 2 ;
4-
56const assert = require ( 'assert' ) ;
6- const common = require ( '../common' ) ;
7- const cp = require ( 'child_process' ) ;
8- const path = require ( 'path' ) ;
9- const targetScript = path . resolve ( common . fixturesDir , 'guess-hash-seed.js' ) ;
7+ const fixtures = require ( '../common/fixtures' ) ;
8+ const { spawnSync } = require ( 'child_process' ) ;
9+ const targetScript = fixtures . path ( 'guess-hash-seed.js' ) ;
1010const seeds = [ ] ;
1111
1212for ( let i = 0 ; i < REPETITIONS ; ++ i ) {
13- const seed = cp . spawnSync ( process . execPath , [ targetScript ] ,
14- { encoding : 'utf8' } ) . stdout . trim ( ) ;
13+ const seed = spawnSync ( process . execPath , [ targetScript ] , {
14+ encoding : 'utf8'
15+ } ) . stdout . trim ( ) ;
1516 seeds . push ( seed ) ;
1617}
1718
1819console . log ( `Seeds: ${ seeds } ` ) ;
19- const hasDuplicates = ( new Set ( seeds ) ) . size !== seeds . length ;
20- assert . strictEqual ( hasDuplicates , false ) ;
20+ assert . strictEqual ( new Set ( seeds ) . size , seeds . length ) ;
You can’t perform that action at this time.
0 commit comments