Skip to content

Commit

Permalink
fix: integration timeout (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
jer3k authored Apr 25, 2024
1 parent 49eaf60 commit 37b59cc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backend-external/tests/integration/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,33 @@ const request = agent(config.get('server:baseURL'));

describe('/ GET', () => {
it('the service should be running', () => {
return request.get('').expect(200);
return request.get('').retry(3).expect(200);
});
});

describe('/v1/docs/ GET', () => {
it('the service should be running', () => {
return request.get('/v1/docs/').expect(200);
return request.get('/v1/docs/').retry(3).expect(200);
});
});

describe('/v1/pay-transparency/ GET', () => {
it('returns error if secret key is not set', () => {
return request.get('/v1/pay-transparency').expect(400);
return request.get('/v1/pay-transparency').retry(3).expect(400);
});
it('returns error if secret key is wrong', () => {
return request
.get('/v1/pay-transparency')
.set('x-api-key', 'wrong_key')
.retry(3)
.expect(401);
});
it('returns data if secret key is provided', () => {
//note: this test requires both backend-external and backend to be running.
return request
.get('/v1/pay-transparency')
.set('x-api-key', config.get('server:apiKey'))
.retry(3)
.expect(200)
.expect(({ body }) => {
expect(body).toHaveProperty('totalRecords');
Expand Down

0 comments on commit 37b59cc

Please sign in to comment.