-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Asynchronous tests when stubbing with sinon #1066
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
@yamsellem I've expanded on the answer here: http://stackoverflow.com/questions/37900687/problems-with-ava-asynchronous-tests-when-stubbing-with-sinon#comment67089250_37900956 |
If the thing that's worrying you is writing |
If it were possible to run each test in its own process, instead of each file, then this would be possible as each process would have access to its own copy of sinon. Incidentally not a bad idea, as an option - but I'm not sure its possible without additional syntactic sugar for that specific case, which may be unwanted. @sindresorhus @novemberborn any interest in such a feature, if it should come up as a PR? (and is even feasible, haven't dug too deep into the worker/process stuff) |
No, it's not something we want to explore right now. |
This is a copy of this stackoverflow question — I'm encountering the same issue, and don't know how to process.
If you run either test alone, the test passes. But if you run these together, the setup for the test A runs, and then before it completes, the setup for test B runs and you get this error:
The stackoverflow answer suggest to
test.serial
on every test — which works. But I'm wondering if there ain't no better way.This may be totally on Sinon, but because I'm switching from Mocha to Ava, I start by asking it here.
Thanks a million for this 🚀 library.
The text was updated successfully, but these errors were encountered: