Skip to content

Commit

Permalink
fix: SO-80 added integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
karol-maciaszek authored and XVincentX committed Apr 11, 2019
1 parent d67d04a commit b1936e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/http-server/src/__tests__/server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,17 @@ describe('server', () => {

expect(response.statusCode).toBe(200);
});

test('should return response even if there is no content defined in spec', async () => {
server = createServer({}, { components: {}, config: { mock: true } });
await server.prism.load({
path: relative(process.cwd(), resolve(__dirname, 'fixtures', 'no-responses.oas2.yaml')),
});

const response = await server.fastify.inject({ method: 'GET', url: '/' });

expect(response.statusCode).toBe(200);
expect(response.headers['content-type']).toEqual('text/plain');
expect(response.payload).toEqual('');
});
});

0 comments on commit b1936e1

Please sign in to comment.