- We have to mock the Meteor Framework in our unit tests using testdouble.js
- (you can read more in here)
- We have to use Babel along with Stryker to transpile our code (see stryker.conf.js)
Unit Tests:
npm test
Mutation Tests:
npm test-stryker
We use a .babelrc
in the root of the project to make Meteor and Mocha compile in the same way. The file used here follows these recommendations. There are a few compromises that you will have to live with in your Meteor app as a result of this:
- It won't allow you to use nested import declarations.
- You cannot use absolute import paths from your project root (Node will read it as being the root of your filesystem)
There may be a way to improve this further using meteor-babel/register
- here is an example. A PR that makes this work would be welcome! Regardless, it seems likely that this situation will improve as Meteor migrates to NPM.