Skip to content

Commit 7c364a2

Browse files
Javier Blancoevanlucas
authored andcommitted
test: use common/fixtures module in hash-seed test
Replace `common.fixturesDir` with `fixtures.path()` usage in test/pummel/test-hash-seed.js. PR-URL: #16823 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3136578 commit 7c364a2

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎test/pummel/test-hash-seed.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
'use strict';
22

3+
// Check that spawn child doesn't create duplicated entries
4+
require('../common');
35
constREPETITIONS=2;
4-
56
constassert=require('assert');
6-
constcommon=require('../common');
7-
constcp=require('child_process');
8-
constpath=require('path');
9-
consttargetScript=path.resolve(common.fixturesDir,'guess-hash-seed.js');
7+
constfixtures=require('../common/fixtures');
8+
const{ spawnSync }=require('child_process');
9+
consttargetScript=fixtures.path('guess-hash-seed.js');
1010
constseeds=[];
1111

1212
for(leti=0;i<REPETITIONS;++i){
13-
constseed=cp.spawnSync(process.execPath,[targetScript],
14-
{encoding: 'utf8'}).stdout.trim();
13+
constseed=spawnSync(process.execPath,[targetScript],{
14+
encoding: 'utf8'
15+
}).stdout.trim();
1516
seeds.push(seed);
1617
}
1718

1819
console.log(`Seeds: ${seeds}`);
19-
consthasDuplicates=(newSet(seeds)).size!==seeds.length;
20-
assert.strictEqual(hasDuplicates,false);
20+
assert.strictEqual(newSet(seeds).size,seeds.length);

0 commit comments

Comments
 (0)