Haven’t had a chance yet - super swamped. Quick Q: does this solution actually work when testing components that import Meteor packages?
Answer: Yes it does. Ok.
And wow… the testing section of the Meteor Guide has grown in leaps and bounds since I last looked. There’s a ton of info there!
The only thing I don’t like about Meteor’s tests is that they take a while to build/run, whereas testing with purely npm & mocha is lightning fast. In an ideal world, I would probably delegate testing responsibilities to different tools, e.g.:
- Use npm, mocha, and enzyme for React component testing
meteor test for Meteor-specific and server-side stuff
The problem with using a non-Meteor way to test React components is that it’ll trip up when it sees code that imports from meteor packages, unless you (somehow) use
proxyquire to make it avoid importing those things, which I haven’t figured out. It all makes my head spin.
But at least the official Meteor route is tried and proven, and well-documented. Time to study!