Suddenly since last weekend, we are facing false positives for rule S2699 (Add at least one assertion to this test cas) on our Jest tests (Angular Project 15.2, Mono Repo NX 15.8).
The tests contain valid assertions but Sonar is rising a code smell.
Hello Hugo and Pascal and thank you for your feedback!
Currently, the rule logic is as described in its definition:
This rule raises an issue when the assertion library chai or sinon is imported but no assertion is used in a test.
For Hugo’s case, you import sinon, but use another lib (vitest) for assertions, hence the FP. We could add vitest in to the list of supported libraries.
@HugoMercierYuc, Could you provide the imports that you are using in your file?