-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Exit with code 1 when nyc doesn't know what to do. (#1070)
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.
- Loading branch information
1 parent
0f745ca
commit 21fb2c8
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,5 +85,6 @@ if ([ | |
}) | ||
} else { | ||
// I don't have a clue what you're doing. | ||
process.exitCode = 1 | ||
yargs.showHelp() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters