False positive: S2699 - Add at least one assertion to this test case

  • What language is this for?
    JavaScript

  • Which rule?
    S2699

  • Why do you believe it’s a false-positive/false-negative?
    Similar issue, but for different imports: False positive - S2699 - Add at least one assertion to this test case - #7 by ilia

  • SonarQube - which version?
    Community Edition v10.5.1 (90531)

  • How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)

It happens when using assert library (from node, node:assert) and sinon.

import assert from "assert";
import sinon from "sinon";

The test has the following structure:


describe ("", () => {
	beforeEach(() => {
		
	});
	afterEach(() => {
		
	});
	describe("", () => {
		it("should exist", () => {
			assert.ok(functionName);
		});
	});
});

Hello Giancarlo,

Thank you for bringing up this issue. We have opened a ticket for it which you can follow here: [JS-187] - Jira

@gian1200 ,

I opened another ticket because the one mentioned earlier is about a different issue. You can track its progress there: [JS-342] - Jira

Kind regards,

Eric.

1 Like

The issue seems to be fixed (status Done). Is the fix going to be available in the next release, or rules are automagically refreshed in the servers with internet (regarding the version)?

I do not see it fixed in Community Build v25.5.0.107428

Hey @gian1200

This should make its way into SonarQube Community Build v25.6 and SonarQube Server v2025.3

1 Like

Awesome! And thanks for the quick reply!!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.