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

Redundant typeof check #3

Closed
kunal-kushwaha opened this issue Jun 14, 2020 · 2 comments
Closed

Redundant typeof check #3

kunal-kushwaha opened this issue Jun 14, 2020 · 2 comments

Comments

@kunal-kushwaha
Copy link
Member

Redundant typeof check in jest-cli/src/cli/index.ts in readResultsAndExit

if (typeof code === 'number' && code !== 0) {

Not a major issue, feedback required

@sauravhiremath
Copy link
Member

sauravhiremath commented Jun 17, 2020

@kunal-kushwaha Yeah, it does seem to do a redundant check here. We can include this fix too, in the main PR #6

// Here testFailureExitCode has type as number
const code = !result || result.success ? 0 : globalConfig.testFailureExitCode;

// ✗✗ The typeof code === 'number' check looks redundant to me, as explained above ✗✗
if (typeof code === 'number' && code !== 0) { ... }

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants