Skip to content

test: add isSupportedLanguage, getSupportedLanguages, and Java analyzer coverage#310

Merged
askpt merged 1 commit into
mainfrom
repo-assist/test-factory-and-java-coverage-e8c2cbf08c53c3a1
May 16, 2026
Merged

test: add isSupportedLanguage, getSupportedLanguages, and Java analyzer coverage#310
askpt merged 1 commit into
mainfrom
repo-assist/test-factory-and-java-coverage-e8c2cbf08c53c3a1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

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

Summary

Adds unit tests for previously untested code paths, growing the unit test count from 65 to 79 tests.

Changes

src/unit/unit.test.ts

  • isSupportedLanguage() tests (3 new): covers all 8 supported language IDs, unsupported/unknown languages, and case-sensitivity
  • getSupportedLanguages() tests (3 new): verifies all expected languages are present, minimum count, and consistency with isSupportedLanguage()
  • Java Analyzer Additional Coverage (8 new): for loop, enhanced-for (for-each), while, do-while, catch clause, ternary expression, nesting penalty, and multi-method analysis

Why

isSupportedLanguage() was added in #305 but had no dedicated unit tests. The Java analyzer (added in #296) had only 2 test cases; the new tests cover all remaining control-flow constructs.

Test Status

npm run compile  → success
npm run lint     → success
npm run test:unit → 79 passing (0 failing)

VS Code integration tests require a display server and are infrastructure-dependent — unrelated to these changes.

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.

To install this agentic workflow, run

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

…er coverage

- Add isSupportedLanguage() tests: all 8 supported languages, unsupported
  languages, and case-sensitivity behaviour
- Add getSupportedLanguages() tests: expected language list, minimum count,
  consistency with isSupportedLanguage()
- Add Java analyzer tests: for loop, enhanced-for (for-each), while, do-while,
  catch clause, ternary expression, nesting penalty, and multi-method analysis
- Unit test count grows from 65 to 79

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@askpt askpt changed the title [repo-assist] test: add isSupportedLanguage, getSupportedLanguages, and Java analyzer coverage [test: add isSupportedLanguage, getSupportedLanguages, and Java analyzer coverage May 16, 2026
@askpt askpt changed the title [test: add isSupportedLanguage, getSupportedLanguages, and Java analyzer coverage test: add isSupportedLanguage, getSupportedLanguages, and Java analyzer coverage May 16, 2026
@askpt askpt marked this pull request as ready for review May 16, 2026 08:30
@askpt askpt self-requested a review as a code owner May 16, 2026 08:30
Copilot AI review requested due to automatic review settings May 16, 2026 08:30
@askpt askpt closed this May 16, 2026
@askpt askpt reopened this May 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.91%. Comparing base (d437734) to head (fae9d7e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
+ Coverage   71.40%   71.91%   +0.51%     
==========================================
  Files          12       12              
  Lines        3521     3521              
  Branches      346      350       +4     
==========================================
+ Hits         2514     2532      +18     
+ Misses       1005      987      -18     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Node-only unit tests to increase coverage for language-support helpers in MetricsAnalyzerFactory and to exercise additional Java cognitive-complexity constructs/edge cases. This strengthens regression protection for both the language routing layer and the Java analyzer’s construct accounting.

Changes:

  • Added unit tests for MetricsAnalyzerFactory.isSupportedLanguage() across supported, unsupported, and case-variant language IDs.
  • Added unit tests for MetricsAnalyzerFactory.getSupportedLanguages() to validate expected IDs and consistency with isSupportedLanguage().
  • Expanded Java analyzer unit coverage for loop constructs, catch clauses, ternaries, nesting penalty, and multi-method analysis.

@askpt askpt merged commit c32855a into main May 16, 2026
35 checks passed
@askpt askpt deleted the repo-assist/test-factory-and-java-coverage-e8c2cbf08c53c3a1 branch May 16, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants