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

fix: Exit with code 1 when nyc doesn't know what to do. #1070

Merged
merged 1 commit into from Apr 17, 2019

Conversation

@coreyfarrell
Copy link
Member

commented Apr 17, 2019

When nyc is not told to do anything this is an error. We already
printed the help message to stderr, now we exit with code 1 to indicate
that nyc exited without doing anything.

Add a test to cover this edge case and verify that both nyc and nyc --help produce output as expected to stdout and stderr, exit with the
proper code.

@coveralls

This comment has been minimized.

Copy link

commented Apr 17, 2019

Coverage Status

Coverage increased (+0.2%) to 96.643% when pulling 6599f11 on coreyfarrell:unknown-main-command into 0f745ca on istanbuljs:master.

@JaKXz
Copy link
Member

left a comment

This makes sense, but I have one note for the tests

test/nyc-integration.js Outdated Show resolved Hide resolved

@coreyfarrell coreyfarrell force-pushed the coreyfarrell:unknown-main-command branch from 9029c20 to 2ff6dba Apr 17, 2019

test/nyc-integration.js Outdated Show resolved Hide resolved
@bcoe
bcoe approved these changes Apr 17, 2019
Copy link
Member

left a comment

seems like a worthwhile fix to me, I'd advocate just using child_process.spawnSync especially given the BUG we're seeing.

test/nyc-integration.js Outdated Show resolved Hide resolved

@coreyfarrell coreyfarrell force-pushed the coreyfarrell:unknown-main-command branch from 2ff6dba to d44a260 Apr 17, 2019

fix: Exit with code 1 when nyc doesn't know what to do.
When nyc is not told to do anything this is an error.  We already
printed the help message to stderr, now we exit with code 1 to indicate
that nyc exited without doing anything.

Add a test to cover this edge case and verify that both `nyc` and `nyc
--help` produce output as expected to stdout and stderr, exit with the
proper code.

@coreyfarrell coreyfarrell force-pushed the coreyfarrell:unknown-main-command branch from d44a260 to 6599f11 Apr 17, 2019

@coreyfarrell coreyfarrell merged commit 21fb2c8 into istanbuljs:master Apr 17, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.2%) to 96.643%
Details

@coreyfarrell coreyfarrell deleted the coreyfarrell:unknown-main-command branch Apr 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.