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

This is the error: SyntaxError: missing ) after argument list #70

Closed smalike closed 8 years ago

smalike commented 8 years ago

$ npm run coverage "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive --timeout 500000 test/ --compilers js:babel-register",

node_modules\.bin\babel-istanbul:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list
    at Object.exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:513:28)
    at Module._extensions..js (module.js:550:10)
    at Object.require.extensions.(anonymous function) [as .js] 
jeffrifwald commented 8 years ago

Is this error happening in Windows? I'm not sure about the gotchas with Istanbul and Windows, but here is the official documentation: https://github.com/gotwarlost/istanbul#usage-on-windows.

danday74 commented 7 years ago

I had this problem, fixed by using WIN approach below ...

LINUX "./node_modules/.bin/istanbul test ./node_modules/.bin/_mocha -- --recursive -R spec" WIN "./node_modules/.bin/istanbul test ./node_modules/mocha/bin/_mocha -- --recursive -R spec"

See https://github.com/gotwarlost/istanbul/issues/13#issuecomment-32001190 for more details

jbarngr commented 7 years ago

@danday74 Your solution worked for me also. Thank you.