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 runs with error exit code 1 #6466

Open
palaniichukdmytro opened this issue Oct 2, 2018 · 4 comments
Open

Coverage runs with error exit code 1 #6466

palaniichukdmytro opened this issue Oct 2, 2018 · 4 comments
Assignees

Comments

@palaniichukdmytro
Copy link

Bug

What is the current behavior?
I get an error error Command failed with exit code 1. during my cover test.

**My test scripts **

"cover": "cross-env NODE_ENV=test nyc --reporter=cobertura --reporter=html --reporter=text-summary node_modules/mocha/bin/_mocha --reporter mocha-junit-reporter --reporter-options mochaFile=../Televic.Mirfus/TestOutput/JUnitResults/ui-unit-tests.xml",
$ yarn cover
yarn run v1.10.1
$ cross-env NODE_ENV=test nyc --reporter=cobertura --reporter=html --reporter=text-summary node_module
s/mocha/bin/_mocha --reporter mocha-junit-reporter --reporter-options mochaFile=../Televic.Mirfus/Test
Output/JUnitResults/ui-unit-tests.xml
Warning: React depends on requestAnimationFrame. Make sure that you load a polyfill in older browsers.
 https://fb.me/react-polyfills

=============================== Coverage summary ===============================
Statements   : 99.65% ( 3715/3728 )
Branches     : 98.78% ( 1700/1721 )
Functions    : 99.48% ( 1542/1550 )
Lines        : 99.6% ( 3250/3263 )
================================================================================
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What is the expected behavior?
Do not produce error

Please mention your node.js, yarn and operating system version.
yarn v1.10.1
node v10.10.0
npm v6.4.1
windows 10

@ghost ghost assigned rally25rs Oct 2, 2018
@ghost ghost added the triaged label Oct 2, 2018
@rally25rs
Copy link
Contributor

rally25rs commented Oct 2, 2018

I believe this would indicate that the script you are running is returning a non-0 exit code. What is the exit code if you run the same command outside of yarn?

Without seeing how your project is set up, I'm assuming cross-env and nyc are dependencies so they should have bin files in node_modules/.bin, making the equivalent command something like

node_modules/.bin/cross-env NODE_ENV=test node_modules/.bin/nyc --reporter=cobertura --reporter=html --reporter=text-summary node_modules/mocha/bin/_mocha --reporter mocha-junit-reporter --reporter-options mochaFile=../Televic.Mirfus/TestOutput/JUnitResults/ui-unit-tests.xml

I think on Windows you can then get the last command's exit code by running

echo %errorlevel%

@palaniichukdmytro
Copy link
Author

palaniichukdmytro commented Oct 2, 2018

I did it in VS code terminal, when I tried in cmd it disapered

@palaniichukdmytro
Copy link
Author

Looks like it does not belong to yarn or node

@rally25rs
Copy link
Contributor

Weird. I'm not sure why it would be different. I don't see a difference on OSX VSCode, but I don't have my Windows machine with me right now to test anything on Win.

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

No branches or pull requests

2 participants