feat: add a seed value to test runs#13400
Conversation
SimenB
left a comment
There was a problem hiding this comment.
exciting stuff! left some quick comments on direction, haven't done a thorough review (currently on vacation, so a bit on and off)
|
@mrazauskas any other comments? If not, I'll merge 🙂 |
|
Thanks! Looks like all is done. |
|
|
||
| ### `showSeed` \[boolean] | ||
|
|
||
| Default: `false` |
There was a problem hiding this comment.
Such a great option, I love it 💕
There was a problem hiding this comment.
I was just about to tag you 🙂 Does this (i.e. this entire implementation, not just this specific option) fit your use case and usage?
There was a problem hiding this comment.
I'm thinking you can just document setting this config flag instead of printing the seed yourself (as a major release I guess)
There was a problem hiding this comment.
It will definitely help a lot. So far @fast-check/jest was mostly responsible for building a seed for fast-check and appending it to the name of the it (and also provide a it tailored for pbt). With both seed and showSeed options altering the name of the test might not be that required.
There was a problem hiding this comment.
I haven't documented the removal of the seed printing yet, but that was my idea when I opened dubzzz/fast-check#3287
Jest 29.2 added an option to set a seed, which fast-check uses, and to show it. In the event of a failure, we can rerun the tests with the same seed, making debugging non-deterministic failures far simpler. I'm not sure why Dependabot isn't updating Jest/ts-jest to v29. Refs #388, a6b0f11, jestjs/jest#13400, dubzzz/fast-check#3332
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Context from this conversation.
jest will now generate a
seedvalue when running via the CLI. Thisseedcan be accessed in the runtime viajest.getSeed().You can also manually specify the seed with
--seed=1234.Test plan
Screen.Recording.2022-10-07.at.21.58.14.mov