-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Isolation of Test scripts #1637
Comments
|
That's a good point. I love Mocha's auto pickup mechanism, and use it as boiler-plate, but nothing wrong with being explicit until a tear down fix is in place. I'll give it a shot, thanks! |
I believe we decided it's not Let us know if it works! (it should) |
Works great 👍 |
Nice :) |
It might not be mocha's fault, but being able to run isolated tests is a critical feature of testing (especially unit testing), so it is sorely missed. Other testing frameworks like AVA have process isolation, so it is certainly a strange decision for mocha not to support some way to do this (even if as a non-default option). |
I have two test scripts in my
tests
pathserver-side.js
andclient-side.js
. Both utilize React and a set of related modules for an "isomorphic" dev experience. Great. Individually, both do their thing, and tests pass. Beautiful. When I allow both to run, that is I don't comment out the other one, theserver-side
fails. Why, oh, why? The problem seems to stem from using React'sTestUtils
library on the client-side , which may be making unknown changes to the node environment (I've already gone down the road of manually setting/unsetting global.window and global.document for similar reasons). That sucks, and it's non-obvious what it's doing. So, yes, I should complain to ReactJS that they need proper tear-downs for whatever environmental modifications they are making. In the mean time though, I'd like my testing framework to be able to run these in isolation.The text was updated successfully, but these errors were encountered: