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
Add a documentation page for how to use faker with testing frameworks #1324
Comments
Maybe in a subsection of the Usage-Page. |
I would vote against creating a 100km scrollable usage page |
One of the best UX I had while searching and learning through docs on a mobile screen while being in a bug was: https://smallrye.io/smallrye-mutiny |
I rarely try to debug an error/develop software while on the phone. |
This should also include some "strange" caveeats of some of the test frameworks: E.g. jest immutably caches the faker instance, thus two parralel test files will generate the exact same values, sometimes. |
Just had a nice convo on discord regarding an issue of using faker with Jest. The issue was faker returning duplicate values when calling
Simple way to replicate the issue - 2 test files and a module shared between them:
My suspicion is that this is due to Jest spinning up a pool of worker child processes and running each spec file in a separate worker. This would imply fresh instance of every module used by tests (including faker). If these were initialized close together we could run into an issue with the same seed used? 2 possible solutions found:
Maybe worth adding to the abovementioned docs :) |
I'd like to be assigned this issue please. |
I haven't been able to recreate this behavior. Running the provided example 30 times, I did not observe any matching values. Are you still able to recreate? |
The issue described #1324 (comment) should be fixed via #1334 (v7.6.0). The original issue "Add a documentation page for how to use faker with testing frameworks" still needs some documentation. |
It's not clear to me how to link the PR to this issue. |
By adding |
…r-with-testing-frameworks-faker-js#1324
…r-with-testing-frameworks-faker-js#1324
…r-with-testing-frameworks-faker-js#1324
We would like to have a documentation page that contains examples how to use faker in combination with testing frameworks like vitest and Cypress
The text was updated successfully, but these errors were encountered: