Commit a8cff7a 1 parent 090cc97 commit a8cff7a Copy full SHA for a8cff7a
File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ // Check that spawn child doesn't create duplicated entries
4
+ require ( '../common' ) ;
3
5
const REPETITIONS = 2 ;
4
-
5
6
const 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' ) ;
10
10
const seeds = [ ] ;
11
11
12
12
for ( 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 ( ) ;
15
16
seeds . push ( seed ) ;
16
17
}
17
18
18
19
console . 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