The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Adding ES6 Support to Tests using Mocha and Babel

Adding ES6 Support to Tests using Mocha and Babel

5:02
By adding ES6 support to our source code, we need to add that same support to our tests so we can consume that synatx. This is quite easy with the `--compilers` flag for `Mocha`.
Watch this lesson now
Avatar
egghead.io

By adding ES6 support to our source code, we need to add that same support to our tests so we can consume that synatx. This is quite easy with the --compilers flag for Mocha.

Avatar
fpaxton

Following my comment on the previous lesson, --compilers will need js:babel-register for the test that watches. For the coverage test, babel-istanbul will need to replace istanbul without the need for --compilers.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?