Skip to content

Commit

Permalink
test: change test meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
XVincentX committed Apr 15, 2019
1 parent fc03e90 commit 5f0c6d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/http-server/src/__tests__/server.oas3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ describe('server', () => {
expect(response.statusCode).toBe(500);
});

test('will return requested response using the __code property', async () => {
test('will return the default response when using the __code property with a non existing code', async () => {
const response = await server.fastify.inject({
method: 'GET',
url: '/pets/123?__code=404',
});

expect(response.statusCode).toBe(404);
expect(response.payload).toBe('');
const payload = JSON.parse(response.payload);
expect(payload).toHaveProperty('code');
expect(payload).toHaveProperty('message');
});

test('will return requested error response with payload', async () => {
Expand Down

0 comments on commit 5f0c6d3

Please sign in to comment.