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: always set exit code if exiting uncleanly #7674

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Conversation

wraithgar
Copy link
Member

@wraithgar wraithgar commented Jul 19, 2024

An erroneous assumption was that if this was explicitly set, then the exit was still intentional. This is not the case.

Closes: #7672

An erroneous assumption was that if this was explicitly set, then the exit was still intentional.  This is not the case.
@wraithgar wraithgar requested a review from a team as a code owner July 19, 2024 17:33
Copy link
Contributor

@hashtagchris hashtagchris left a comment

Choose a reason for hiding this comment

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

Looks good. Left optional suggestions.

lib/cli/exit-handler.js Outdated Show resolved Hide resolved
t.strictSame(logs, [])
t.strictSame(errors(), [''], 'one empty string')
t.equal(process.exitCode, 1)
Copy link
Contributor

@hashtagchris hashtagchris Jul 19, 2024

Choose a reason for hiding this comment

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

Optional: Add a dedicated test that verifies 0 is replaced by a non-zero value. The test name might make things click for someone.

Co-authored-by: Chris Sidi <[email protected]>
@wraithgar wraithgar merged commit 4e81a6a into latest Jul 29, 2024
22 checks passed
@wraithgar wraithgar deleted the gar/exit-handler-code branch July 29, 2024 16:40
@github-actions github-actions bot mentioned this pull request Jul 24, 2024
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.

[BUG] npm error Exit handler never called exits with status code 0
2 participants