-
-
Notifications
You must be signed in to change notification settings - Fork 229
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 tests #48
add tests #48
Conversation
Fixes sindresorhus#34 - Adds some tests for functionality copied from `child_process` in sindresorhus#27. - Normalises the result and error objects further. Each now has `killed`, `signal` and `cmd` properties. - NYC was not ignoring the `fixtures` directory. Fixed that, and configured nyc in package.json instead of via CLI.
Travis tests just appear to hang. AVA is not exiting. Works fine locally. |
Maybe try adding |
}); | ||
|
||
// TODO: Should this really be the case, or should we improve on child_process? | ||
test('err.killed is false if process was killed indirectly', async t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sindresorhus - What do you think about this?
Right now, we have this behavior:
cp.kill(); // err.killed will be true
process.kill(cp.pid); // err.killed will be false
This mimics the behavior of child_process.exec
, but it doesn't make a lot of sense to me. If the process is killed, shouldn't killed
be true regardless of how it was done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm with you on this James. If it's killled, it's killed, regardless of how it was done. And if it is killed, jou woild expect that flag to be true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
Landing this to unblock work on |
Fixes #34
child_process
in Use spawn instead of execFile #27.killed
,signal
andcmd
properties.fixtures
directory. Fixed that, and configured nyc in package.json instead of via CLI.