Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit af8b17a

Browse filesBrowse files
Javier BlancoMylesBorins
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 3a3792b commit af8b17a
Copy full SHA for af8b17a

File tree

Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboard
+9-9Lines 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
const REPETITIONS = 2;
4-
56
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');
1010
const seeds = [];
1111

1212
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();
1516
seeds.push(seed);
1617
}
1718

1819
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);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.