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

add tests #48

Merged
merged 6 commits into from
Aug 2, 2016
Merged

add tests #48

merged 6 commits into from
Aug 2, 2016

Conversation

jamestalmage
Copy link
Contributor

Fixes #34

  • Adds some tests for functionality copied from child_process in Use spawn instead of execFile #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.

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.
@jamestalmage
Copy link
Contributor Author

Travis tests just appear to hang. AVA is not exiting. Works fine locally.

@sindresorhus
Copy link
Owner

Maybe try adding --serial to pinpoint where it hangs? We really need to add better output when tests hang...

});

// 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 => {
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

@sindresorhus
Copy link
Owner

@sindresorhus sindresorhus merged commit b15483a into sindresorhus:master Aug 2, 2016
@sindresorhus
Copy link
Owner

Landing this to unblock work on execa. We can continue the unresolved issue in #52.

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

Successfully merging this pull request may close these issues.

Add some tests around the logic copied out of execFile
3 participants