You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, randJobTitle() is called with company-seed instead of person-seed, because the createCompany() that's called before it has changed the seed globally.
Proposed solution
In such cases it would be great if we were able to instantiate falso, like so
This would isolate and prevent unexpected side effects like in the example above, where changing the seed somewhere affects the whole application after it.
Alternatives considered
No response
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered:
This is important for test runners that don't isolate the runner processes (ie. mocha, Node built-in test runner, ...). The implementation could as well be done creating an object factory, that would avoid prototype, while keeping TS interface guarantees.
Description
Picture this:
In this example,
randJobTitle()
is called withcompany-seed
instead ofperson-seed
, because thecreateCompany()
that's called before it has changed the seed globally.Proposed solution
In such cases it would be great if we were able to instantiate falso, like so
This would isolate and prevent unexpected side effects like in the example above, where changing the seed somewhere affects the whole application after it.
Alternatives considered
No response
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered: