-
which versions are you using SonarQube Server : 10.4
-
how is SonarQube deployed: hosted on azure VM
-
what are you trying to achieve: remove false positives
-
what have you tried so far to achieve this - we use the Sinon package for various tests, and Sonaqube does not recognise the assertions that come with Sinon as valid assertions.
Unfortunately, the rule may not detectsinon.assert.*
methods as real assertions because it’s only looking for things likeexpect()
,assert.*
, We’re asking for alternatives solutions to
adding an exception for Sinon assertion methods in our Typescript profile. -
Example of code:
it('should redirect to the organisation details page with url param eu if ' +
'selected and there are no validation errors', () => {
request.payload = {
location: 'eu'
}
route.handler(request, h)
sinon.assert.calledOnce(h.redirect)
sinon.assert.calledWith(h.redirect, '/protected/bcp-admin/new/eu/organisation-details')
})
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!