Skip to content

test: add unit coverage for isOutermostInSameOperatorChain root-node branch - #577

Merged
askpt merged 2 commits into
mainfrom
repo-assist/test-complexity-helpers-coverage-20260827-99a1cf1e37027d90
Aug 29, 2026
Merged

test: add unit coverage for isOutermostInSameOperatorChain root-node branch#577
askpt merged 2 commits 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>
@askpt askpt changed the title [repo-assist] test: add unit coverage for isOutermostInSameOperatorChain root-node branch test: add unit coverage for isOutermostInSameOperatorChain root-node branch Aug 29, 2026
@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.11%. Comparing base (e759b8c) to head (a2e22f3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #577      +/-   ##
==========================================
+ Coverage   98.04%   98.11%   +0.07%     
==========================================
  Files          12       12              
  Lines        3931     3931              
  Branches      450      451       +1     
==========================================
+ Hits         3854     3857       +3     
+ Misses         77       74       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@askpt
askpt marked this pull request as ready for review August 29, 2026 10:40
@askpt
askpt self-requested a review as a code owner August 29, 2026 10:40
Copilot AI balanced review requested due to automatic review settings August 29, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The test-only changes accurately cover the helper’s branching behavior without affecting production code.

Pull request overview

Adds focused unit coverage for the shared operator-chain helper.

Changes:

  • Tests root-node, parent-type, operator, and array-type branches.
  • Uses lightweight typed syntax-node mocks.
File summaries
File Description
src/unit/unit.test.ts Adds five helper unit tests.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@askpt
askpt merged commit 6d23be7 into main Aug 29, 2026
11 checks passed
@askpt
askpt deleted the repo-assist/test-complexity-helpers-coverage-20260827-99a1cf1e37027d90 branch August 29, 2026 10:42
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.

2 participants