- ALM used : Azure DevOps
- CI system used : Azure DevOps
- Languages of the repository : typescript
- Error observed : False positive - S2699 - Add at least one assertion to this test case
- Steps to reproduce :
GitHub - HugoMercierYuc/sonar-jest-sinon
This is a default NX repository for Angular with Jest, when you import sinon
in your unit test file, you get the false-positive Sonar issue.
- open src/app/app.component.spec.ts
- the 3 unit tests raising a Sonar issue S2699
- if you remove the third test and remove the line
import { spy } from ‘sinon’;
=> the Sonar issue S2699 is not raised anymore
new ticket after my first one was closed : False positive - S2699 - Add at least one assertion to this test case
Thanks for your help
Hugo