False positive for rule typescript:S2699 for vitest browser mode tests

Hello everybody,

we are using SonarQube Server Enterprise Edition v2025.1 (102418) and we experience false positives when writing browser mode tests in vitest (Browser Mode | Guide | Vitest).

To make it more clear, it is the assertion expect.element(someElement) that isn’t recognized as an assertion.

It would be great if that could be changed.
Thanks a lot in advance for your efforts!

Hey there.

Thanks for the report!

There’s a rather broad ticket here (JS-627) I’m happy to make sure captures the details of your report. I’ve also gone ahead and linked your thread to that ticket.

Sorry for the late reply, I was on vacation.
Just wanted to thank for your quick reply and taking care of the issue!

1 Like