-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Add some CLI testing #224
Add some CLI testing #224
Conversation
@addaleax awesome \o/ thanks for biting the bullet and starting to write some integration tests for the CLI. A few thoughts:
Really appreciate your contributions \o/ |
Sounds like a good idea. Two things:
|
@addaleax correct me if I'm wrong, but I don't think the build step for I would say: if the tests are specifically exercising aspects of the cli: how it parses arguments, its various commands, its exit codes; let's pull them into this new file. The build step of the tests is designed to test the nitty-gritty functionality if |
@bcoe No, you’re right, that’s why I’m asking :-) I’ll try that then, shouldn’t take too long. |
|
@bcoe Since all CI tests run on Node.js >= 0.12, is using |
Correct. You probably still need a build step to create You should do something similar to this to determine if the covered file exists or not. @addaleax If the above stuff regarding coverage is confusing, feel free to just focus on writing some good tests and I can add coverage in another PR when you are done. |
@jamestalmage It’s not confusing by itself – like, I know the purpose and how it works in theory – but you obviously have the advantage of practical experience with the necessary steps. So, if you have the time, feel free to do that 👍 |
6a0dfc2
to
1e5a17c
Compare
Check that `--check-coverage` sets the exit code correctly for sufficient/insufficient line coverage, and make sure that that does not override a failure-indicating return code from the test command.
Adds tests for checking that `nyc npm test` works, one for when the npm `test` script directly refers to the JS script and one for when npm runs nested lifecycle scripts. This is a regression test for istanbuljs#190.
Move the recently added test which do not touch `index.js` code directly into `nyc-bin.js` and their corresponding fixtures to `test/fixtures/cli`.
This also belongs to istanbuljs#190, but the new tests include actual fake “npm” executables with both absolute shebangs and the twisted shebang that comes with current Node.js binary distribution tarballs.
@addaleax looks like you might have already, but if you rebase these tests should now start passing. |
@addaleax this rocks and you rock. |
Add regression tests for #209 and #190. Feel very free to point out things you’d like to be changed! 😄
And btw, these tests should work on CI systems, but fail for me locally when I use the node/npm binaries that are not shipped with their tarballs (
make install
from the Node.js git source). istanbuljs/spawn-wrap#19 should address that, though.