diff --git a/test/modules/color.spec.ts b/test/modules/color.spec.ts index 9eb64d61c50..0e14726659b 100644 --- a/test/modules/color.spec.ts +++ b/test/modules/color.spec.ts @@ -22,9 +22,6 @@ describe('color', () => { ); }); - // Create and log-back the seed for debug purposes - faker.seed(Math.ceil(Math.random() * 1_000_000_000)); - describe.each(times(NON_SEEDED_BASED_RUN).map(() => faker.seed()))( 'random seeded tests for seed %i', () => { diff --git a/test/modules/science.spec.ts b/test/modules/science.spec.ts index 051fecbb3cf..268da08ff80 100644 --- a/test/modules/science.spec.ts +++ b/test/modules/science.spec.ts @@ -10,9 +10,6 @@ describe('science', () => { t.itEach('chemicalElement', 'unit'); }); - // Create and log-back the seed for debug purposes - faker.seed(Math.ceil(Math.random() * 1_000_000_000)); - describe.each(times(NON_SEEDED_BASED_RUN).map(() => faker.seed()))( 'random seeded tests for seed %i', () => { diff --git a/test/utils/mersenne.spec.ts b/test/utils/mersenne.spec.ts index 4699b9b0706..fe1b4bbc2cb 100644 --- a/test/utils/mersenne.spec.ts +++ b/test/utils/mersenne.spec.ts @@ -1,5 +1,6 @@ import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; import { MersenneTwister19937 } from '../../src/internal/mersenne'; +import { randomSeed } from '../../src/internal/seed'; import type { Randomizer } from '../../src/randomizer'; import { generateMersenne32Randomizer, @@ -15,18 +16,12 @@ import { const NON_SEEDED_BASED_RUN = 25; -function newTwister( - seed: number = Math.random() * Number.MAX_SAFE_INTEGER -): MersenneTwister19937 { +function newTwister(seed: number = randomSeed()): MersenneTwister19937 { const twister = new MersenneTwister19937(); twister.initGenrand(seed); return twister; } -function randomSeed(): number { - return Math.ceil(Math.random() * 1_000_000_000); -} - describe('MersenneTwister19937', () => { describe('genrandInt32()', () => { it('should be able to return 0', () => { @@ -116,7 +111,6 @@ describe.each([ }); }); - // Create and log-back the seed for debug purposes describe.each( times(NON_SEEDED_BASED_RUN).flatMap(() => [ [randomSeed()],