Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve issue #4459: Fix FP S2699 (Tests should include assertions): global expect() aren't detected #4628

Merged
merged 1 commit into from Mar 26, 2024

Conversation

ericmorand-sonarsource
Copy link
Contributor

Fixes #4459

@vdiez vdiez merged commit 201cf01 into SonarSource:master Mar 26, 2024
17 checks passed
@@ -19,6 +19,10 @@ describe('vitest test cases', () => {
check();
});

it('recognizes global expect as an assertion', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq: this test is exactly the same as the one in lines 10-12. Whats the change here? Why is it marked as compliant when it seems it should only become compliant after your update?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very good point. The test I added does not prove anything since expect is imported in this file and my test intended to prove that expect was recognized as an assertion even when it is not imported.

I'll add a dedicated test. Thanks for noticing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix FP S2699 (Tests should include assertions): global expect() aren't detected
3 participants