Use what Jest documentation describes here to check if a server returns valid OpenAPI responses.
Using Supertest for example:
describe('GET /users', function() {
it('responds with json', function() {
return request(app)
.get('/users')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(200)
.then(response => {
expect(response.body).toMatchOpenAPIOperation('getPets')
})
});
});