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 test for options.cleanup #224

Merged
merged 2 commits into from May 7, 2019
Merged

Fix test for options.cleanup #224

merged 2 commits into from May 7, 2019

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented May 7, 2019

The unit test for options.cleanup has several issues and wasn't checking this feature properly.

It first noticed that some lines of code of this feature were not test covered. Then I saw some inconsistencies between the names of the tests and which signals were triggered:

test('cleanup - SIGINT', spawnAndKill, 'SIGINT', true);
test('cleanup - SIGKILL', spawnAndKill, 'SIGTERM', true);
test('cleanup false - SIGINT', spawnAndKill, 'SIGTERM', false);
test('cleanup false - SIGKILL', spawnAndKill, 'SIGKILL', false);

Digging deeper, the unit test was not checking the feature properly. This fixes it and also removes any timeout, making it more predictable.

@ehmicky ehmicky requested a review from sindresorhus May 7, 2019 17:48
@sindresorhus sindresorhus merged commit c0d058c into master May 7, 2019
@sindresorhus sindresorhus deleted the feature/fix-cleanup branch May 7, 2019 18:21
@sindresorhus
Copy link
Owner

Good find 👌

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.

None yet

2 participants