You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 useValidTestTitle reports RegExp.prototype.test() calls as tests #12027
The nursery rule useValidTestTitle treats any call to a method named test as a test declaration. A regular expression's .test(value) is then reported as a test whose title is not a string.
repro.ts:2:58 lint/nursery/useValidTestTitle
× The test title is not a string.
> 2 │ export const code = lines.filter((line) => !/^\s*#/.test(line));
│ ^^^^
In our repository, all 39 of the rule's findings were this shape, and none was a real test.
Expected result
No diagnostic. A member call such as /re/.test(x) or pattern.test(x) is not a test declaration, so the rule would check only calls to a test function, such as test(...), it(...) and describe(...), and their modifiers like test.skip(...). The rule was ported in #9176.
Activity
fix(lint): only match test callees rooted in an identifier
fix(lint): only match test callees rooted in an identifier
Update dependency @biomejs/biome to v2.5.15 (#51)
Update dependency @biomejs/biome to v2.5.15 (#25)
Update dependency @biomejs/biome to v2.5.15 (#1775)