Skip to content

test: simplify GitHub CLI mock responses - #3395

Merged
setchy merged 1 commit into
mainfrom
test/sonar-cli-mock-readability
Oct 9, 2026
Merged

setchy merged 1 commit into
mainfrom
test/sonar-cli-mock-readability

Conversation

@setchy

@setchy setchy commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

Replace the nested response-selection ternary in the GitHub CLI authentication test mock with straightforward if/else if branches.

Preserve rejected-credential responses, user identity responses, empty successful responses, status codes, headers, and request recording.

Addresses the sonarjs/no-nested-conditional finding from the one-off test-code scan. Only src/renderer/utils/forges/github/cli-auth.test.ts changes; no production authentication behavior, dependencies, or configuration changes.

Validation

  • Focused GitHub CLI credential-lifecycle suite: 6 tests passed.
  • Full suite: 1,865 tests passed across 186 files.
  • TypeScript, formatting/lint checks, and production build passed. The build emitted a non-fatal chunk-size warning.
  • Type-aware SonarJS recommended-rule scan of the changed file: zero findings and zero parsing errors. This is a local ESLint-plugin result, not a claim about SonarCloud issue closure.

@setchy
setchy requested a review from afonsojramos as a code owner October 8, 2026 23:58
@github-actions github-actions Bot added the test Enhancements to test coverage or quality label Oct 8, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@setchy
setchy merged commit 82dd391 into main Oct 9, 2026
19 checks passed
@setchy
setchy deleted the test/sonar-cli-mock-readability branch October 9, 2026 00:03
@github-actions github-actions Bot added this to the Release 7.10.0 milestone Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Enhancements to test coverage or quality

Development

Successfully merging this pull request may close these issues.

1 participant