Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a seed to Chance for repeatability #124

Open
destiny-index opened this issue Jan 9, 2018 · 1 comment
Open

Provide a seed to Chance for repeatability #124

destiny-index opened this issue Jan 9, 2018 · 1 comment

Comments

@destiny-index
Copy link

Is it possible to provide a seed to the factory so that running factory.chance will give repeatable results?

The Chance documentation says that a seed can be provided to Chance using new Chance(mySeed) but I'm not sure if there is a way to pass the seed to the instance of Chance that factory-girl uses.

@andrewferk
Copy link

Unfortunately, new Chance() appears to be hardcoded and no configurable seed is being provided.

https://github.com/aexmachina/factory-girl/blob/master/src/generators/ChanceGenerator.js#L5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants