fix(code-quality): stop skipped-tests-need-tracking reporting skips in strings and comments - #64
Merged
Conversation
…cking The rule scanned each source line for the text of a skip, so it reported it.skip( inside a string, a template literal and a comment. Find the skip on the CallExpression instead and keep the text lookback for the tracking marker only. The report now sits on the callee. Closes #63
Merged
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.
Closes #63
Summary
skipped-tests-need-trackingscanned each source line for the text of a skip, soit.skip(inside a string literal, a template literal or a comment was reported as a skipped test.CallExpression: the.skip/.fixmemodifier onit,testordescribe(also through a member,test.describe.skip(), and thexit/xdescribe/xtestaliases.it.skip,xit) or thenode:testoption instead of the whole line from column 1. The line is unchanged.runnerNamecopy is replaced by the shared helper inutils/ast.Every skip form the line scan matched is still reported. Not widened here:
it.skip.each(table)(...)andit.concurrent.skip(...)were not matched before and are not matched now.Test plan
node:testprobe in a string, an uncalledit.skipreference, a marker on a chain split over lines.xtest, a nested skip,test.describe.skip(,describe.skip (and a real skip next to the same text in a string and a comment (one report).dist:string [],template [],comment [],real [ '1:1' ].bun run build,bun run typecheck,bun run test(ESLint 10 and 9, all 12 packages),bun run docs:build: all green locally.