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

Fix FP S2699 (assertions-in-tests): Add support for supertest #4631

Closed
ilia-kebets-sonarsource opened this issue Mar 27, 2024 · 1 comment · Fixed by #4636
Closed

Fix FP S2699 (assertions-in-tests): Add support for supertest #4631

ilia-kebets-sonarsource opened this issue Mar 27, 2024 · 1 comment · Fixed by #4636

Comments

@ilia-kebets-sonarsource
Copy link
Contributor

Supertest is a lib to test API routes, compatible with express. It implements an expect() function like the following.

This issue was discovered as part of the March '24 coverage hardening.

Reproducer:

import request from 'supertest';

describe('foo', function () {
    it('should work', function () {
        return request(app).get(`/foo/bar`).expect('Content-Type', /json/u).expect(200);
    });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants