jeffrifwald / babel-istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
144 stars 23 forks source link

babel-istanbul not working: SyntaxError: Unexpected reserved word #65

Closed ghost closed 8 years ago

ghost commented 8 years ago

When trying to run:

babel-istanbul cover _mocha test/**.js

I get:

import { toCamelCase, toSnakeCase } from '../src'
^^^^^^
SyntaxError: Unexpected reserved word
jeffrifwald commented 8 years ago

You'll need to run your tests with babel-node. Install babel-cli and try this command:

babel-node babel-istanbul cover _mocha test/*.js

ghost commented 8 years ago

@jmcriffey it is not working.

Trying your solution I got: Error: Cannot find module '/Users/Moritz/case-converter/babel-istanbul'

Then tried: babel-node node_modules/babel-istanbul cover _mocha test/*.js

Which just seems to do nothing.

jeffrifwald commented 8 years ago

Yeah I forgot you need to point to the bin.

babel-node node_modules/.bin/babel-istanbul cover _mocha test/*.js