Conversation
…mps, and cache Previously uncovered paths in the TypeScript and JavaScript analyzers (ternary expressions, catch clauses, nullish-coalescing ??, labeled break/continue) now have dedicated unit tests. Two new suites cover: - Analysis cache behaviour: hit consistency and LRU eviction under load - createAnalyzer error handling: throws correctly for a missing class metricsAnalyzerFactory.ts now achieves 100 % statement/branch coverage. Overall branch coverage for the analyzer languages improves from ~75 % to ~82 %. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #247 +/- ##
==========================================
+ Coverage 67.26% 68.80% +1.53%
==========================================
Files 8 8
Lines 2936 2936
Branches 276 283 +7
==========================================
+ Hits 1975 2020 +45
+ Misses 959 914 -45
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the Node.js unit test suite to cover previously untested cognitive-complexity paths in the JavaScript/TypeScript analyzers and MetricsAnalyzerFactory (cache behavior and createAnalyzer error handling), aiming to improve coverage under npm run test:unit.
Changes:
- Added new TypeScript analyzer tests for ternary, catch clauses, nullish coalescing, and labeled break.
- Added new JavaScript analyzer tests for the same patterns (with labeled continue).
- Added new tests targeting
MetricsAnalyzerFactorycache behavior andcreateAnalyzer’s thrown error message.
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 12 new unit tests across four new
describeblocks to cover code paths that were previously untested.metricsAnalyzerFactory.tsnow achieves 100 % statement, branch, function, and line coverage undernpm run test:unit.What was uncovered
typescriptAnalyzer.ts??operator, labeled break/continuejavascriptAnalyzer.tsmetricsAnalyzerFactory.tscreateAnalyzererror throwNew test suites added (in
src/unit/unit.test.ts)??, labeledbreak??, labeledcontinueCoverage delta
metricsAnalyzerFactory.tstypescriptAnalyzer.tsjavascriptAnalyzer.tsTest Status
npm run compile✅ no errorsnpm run lint✅ no errorsnpm run test:unit✅ 47 tests pass (was 35)