Skip to content

Instantly share code, notes, and snippets.

@bcoe
Created November 25, 2015 16:32
Show Gist options
  • Select an option

  • Save bcoe/bbace365e740bb83499e to your computer and use it in GitHub Desktop.

Select an option

Save bcoe/bbace365e740bb83499e to your computer and use it in GitHub Desktop.
nyc-es6.md
  1. 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

  1. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment