| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3136578 commit 7c364a2
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,20 +1,20 @@ | |||
| 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); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments