MCPcopy Index your code
hub / github.com/nodejs/node / sequence

Function sequence

test/parallel/test-runner-seeded-generator.js:7–14  ·  view source on GitHub ↗
(seed, length = 10)

Source from the content-addressed store, hash-verified

5const { createSeededGenerator, kMaxRandomSeed } = require('internal/test_runner/utils');
6
7function sequence(seed, length = 10) {
8 const random = createSeededGenerator(seed);
9 const values = [];
10 for (let i = 0; i < length; i++) {
11 values.push(random());
12 }
13 return values;
14}
15
16// The same seed must always produce the same sequence so that
17// --test-random-seed reproduces a randomized test order across runs.

Callers 1

Calls 3

createSeededGeneratorFunction · 0.85
randomFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected