The first one is Babel's compiler. Mocha, our test runner, will use it to be able to read our ES6 code and test. The second one is all ES5 configuration specs bundled in one single package.
Babel configuration file
Last but not least, we need to create a .babelrc file. This will tell Babel what it needs to load, for example, the ES5 specs we installed above:
Now it's time to add some dependencies to transpile our code back to ES5.
Dependencies
Add this two modules to your Dev Dependencies:
The first one is Babel's compiler. Mocha, our test runner, will use it to be able to read our ES6 code and test. The second one is all ES5 configuration specs bundled in one single package.
Babel configuration file
Last but not least, we need to create a
.babelrc
file. This will tell Babel what it needs to load, for example, the ES5 specs we installed above:Next step
10. Create your first automated test to cover the public interface