Skip to content

[repo-assist] test: add unit coverage for isOutermostInSameOperatorChain root-node branch - #577

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/test-complexity-helpers-coverage-20260827-99a1cf1e37027d90
Draft

[repo-assist] test: add unit coverage for isOutermostInSameOperatorChain root-node branch#577
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/test-complexity-helpers-coverage-20260827-99a1cf1e37027d90

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds direct unit tests for the shared isOutermostInSameOperatorChain() helper in complexityHelpers.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 where node.parent is null — had 0 branch coverage hits (branch coverage for this file: 85.71%).

Changes

  • New describe("complexityHelpers: isOutermostInSameOperatorChain") block in src/unit/unit.test.ts using lightweight mock nodes (only .parent/.type are read by the function, so a real tree-sitter parse tree is not needed).
  • Covers: no-parent (root) case, same-kind/same-operator inner node, same-kind/different-operator, different-parent-type, and the array-of-sameKindTypes form.

Test Status

  • npm run compile: passes
  • npm run lint: passes
  • npm run test:unit: 241 tests passing (up from 236)
  • Coverage: complexityHelpers.ts branch 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 CI

This 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.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@42c2ab5b4e4c9273534c39259b2e0df7f20f07e9

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants