Skip to content

'node:test' - expose a seed to allow reproducible tests with pseudo random generators #51870

Description

@gerardolima

What is the problem this feature will solve?

I use a pseudo random generator on my unit tests (ie). For the tests to be reproducible, I am seeding the random generator with an ENV variable (process.env['RANDOM_SEED']).

What is the feature you are proposing to solve the problem?

I believe it would be clearer if the TestContext would provide a documented seed, as Jest provides with Jest.getSeed().

What alternatives have you considered?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature requestIssues requesting new Node.js features.test_runnerIssues and PRs related to the test runner subsystem.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions