- rather than running tests against transpiled code, run
require('babel-core/register')before beginning the test run. Here's an example of how this works with mocha:
{
"scripts": {
"test": "mocha --compilers js:babel-core/register"
}
}See further documentation here: https://babeljs.io/docs/setup/#babel_register
- run your tests with nyc like usual:
nyc test.
nyc now uses source-maps and getters and setters to inject itself in front of babel-core/register.