fix: correct bugs in testaro targetsNear test - #136
Open
jrpool wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes correctness issues in the targetsNear Testaro rule’s reported severities/totals and prevents a crash in summary mode (withItems: false) when instances don’t carry an xPath, addressing issue #108.
Changes:
- Align summary-instance
ordinalSeverityvalues with the itemized-path severities (2for <44px,3for <24px). - Fix
totalsordering so counts land in the correct severity slots ([0, 0, minorCount, majorCount]). - Guard the XPath→catalog-index conversion so instances without
xPathno longer throw in summary mode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
testaro/targetsNear.ts |
Corrects summary-mode severities/totals and guards XPath conversion to prevent summary-mode crashes. |
testaro/targetsNear.js |
Updates the emitted JS to match the TypeScript fixes (severity/totals alignment + XPath guard). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Correct bugs in the test of
targetsNearrule of thetestarorule engine:This revision resolves issue #108.