-
Notifications
You must be signed in to change notification settings - Fork 141
sinon.sandbox analog? #188
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
Comments
There is not, but if you consider what Sandbox is a really odd feature, that I think is more intended to (1) scope global sinon configuration down, and (2) give some way of resetting more than one double at a time (I don't believe there is a global In fact, take a look here for why sandbox doesn't actually solve the problem you suggest it would: avajs/ava#1066 -- as long as you're globally replacing something, you can't run tests concurrently safely, full stop. So instead what I'd suggest is to either (1) mark your unit tests that use td.js to replace production-side code as Fears of running |
I wrote more about this last year here: #131 (comment) |
Some test runners, e.g.
ava
, can execute your tests in parallel. Having a single "mocking" context might lead to race conditions when doingtd.reset()
. Is there a way of creating an isolated mocking context that could be restored independently of the other tests, likesinon.sandbox
provides?The text was updated successfully, but these errors were encountered: