[repo-assist] test: add unit coverage for isOutermostInSameOperatorChain root-node branch - #577
Draft
github-actions[bot] wants to merge 1 commit into
Conversation
…branch Adds direct unit tests for complexityHelpers.isOutermostInSameOperatorChain, covering the previously-untested branch where a node has no parent (root of the tree). Also exercises the same-operator-inner-node, different-operator, different-parent-type, and array sameKindTypes cases with lightweight mock nodes (no tree-sitter parser needed since the function only reads .parent/.type). Branch coverage for complexityHelpers.ts: 85.71% -> 100%. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds direct unit tests for the shared
isOutermostInSameOperatorChain()helper incomplexityHelpers.ts(extracted in a previous Repo Assist PR and used by all 6 language analyzers). The one previously-untested branch — the root-of-tree case wherenode.parentisnull— had 0 branch coverage hits (branch coverage for this file: 85.71%).Changes
describe("complexityHelpers: isOutermostInSameOperatorChain")block insrc/unit/unit.test.tsusing lightweight mock nodes (only.parent/.typeare read by the function, so a real tree-sitter parse tree is not needed).sameKindTypesform.Test Status
npm run compile: passesnpm run lint: passesnpm run test:unit: 241 tests passing (up from 236)complexityHelpers.tsbranch coverage 85.71% -> 100%; overall repo coverage 98.71/94.83/99.1/98.71 (thresholds 95/88/97/95)npm test(vscode-test): not run in this sandbox (no network access to download the VS Code test binary) — expected sandbox limitation, should be verified by CIThis is a low-risk, test-only change (Task 9 — Testing Improvements).
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
releaseassets.githubusercontent.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run