'node:test' - expose a seed to allow reproducible tests with pseudo random generators #51870
Closed as not planned
seed to allow reproducible tests with pseudo random generators #51870
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