Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage test errors on windows #1101

Closed
RedSparr0w opened this issue Sep 26, 2017 · 0 comments · Fixed by #1102
Closed

coverage test errors on windows #1101

RedSparr0w opened this issue Sep 26, 2017 · 0 comments · Fixed by #1102
Labels
developer-experience Dev tooling, test framework, and CI

Comments

@RedSparr0w
Copy link
Member

RedSparr0w commented Sep 26, 2017

When running npm run coverage:test:services -- --only=whateveryourtesting
you will get an error in console and the coverage test will not run:

C:\Users\Dan\Documents\GitHub\shields>npm run coverage:test:services -- --only=chrome-web-store

> gh-badges@1.3.0 coverage:test:services C:\Users\Dan\Documents\GitHub\shields
> istanbul cover _mocha service-tests/runner/cli.js --dir coverage/services -- --delay "--only=chrome-web-store"

No coverage information was collected, exit without writing coverage information
C:\Users\Dan\Documents\GitHub\shields\node_modules\.bin\_mocha.CMD:1
(function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0\node.exe" (
                                                              ^
SyntaxError: Invalid or unexpected token
    at Object.exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Object.Module._extensions.(anonymous function) [as .js] (C:\Users\Dan\Documents\GitHub\shields\node_modules\istanbul\lib\hook.js:109:37)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Function.Module.runMain (module.js:605:10)
    at runFn (C:\Users\Dan\Documents\GitHub\shields\node_modules\istanbul\lib\command\common\run-with-cover.js:122:16)
    at C:\Users\Dan\Documents\GitHub\shields\node_modules\istanbul\lib\command\common\run-with-cover.js:251:17

npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Dan\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "coverage:test:services" "--" "--only=chrome-web-store"
npm ERR! node v7.6.0
npm ERR! npm  v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gh-badges@1.3.0 coverage:test:services: `istanbul cover _mocha service-tests/runner/cli.js --dir coverage/services -- --delay "--only=chrome-web-store"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gh-badges@1.3.0 coverage:test:services script 'istanbul cover _mocha service-tests/runner/cli.js --dir coverage/services -- --delay "--only=chrome-web-store"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the gh-badges package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     istanbul cover _mocha service-tests/runner/cli.js --dir coverage/services -- --delay "--only=chrome-web-store"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs gh-badges
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls gh-badges
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Dan\AppData\Roaming\npm-cache\_logs\2017-09-26T21_36_26_831Z-debug.log

This comment has a fix which is to provide the relative path to the _mocha JS file.

which would change these lines to be:

    "coverage:test:js": "istanbul cover node_modules/mocha/bin/_mocha '*.spec.js' 'lib/*.spec.js' --dir coverage/js",
    "coverage:test:services": "istanbul cover node_modules/mocha/bin/_mocha service-tests/runner/cli.js --dir coverage/services -- --delay",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience Dev tooling, test framework, and CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants