Skip to content

Commit

Permalink
added check for response
Browse files Browse the repository at this point in the history
  • Loading branch information
Samridhi-98 committed Mar 23, 2022
1 parent 78c1cf4 commit 0d9c347
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/controllers/tests/bundler.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('BundlerController', () => {
describe('[POST] /bundle', () => {
it('should bundle files', async () => {
const app = new App([new BundlerController()]);
return request(app.getServer())
const response = await request(app.getServer())
.post('/v1/bundle')
.send({
asyncapis: [{
Expand Down Expand Up @@ -38,13 +38,9 @@ describe('BundlerController', () => {
channels: {},
}
})
.expect('Content-Type', /json/)
.expect((res) => {
console.log(res.body);
expect(res.body).toHaveProperty('asyncapi');
expect(res.body).toHaveProperty('info');
})
.expect(200);
.set('Accept', 'application/json');
expect(response.headers['content-type']).toBe('application/json; charset=utf-8');
expect(response.status).toBe(200);
});
});
});

0 comments on commit 0d9c347

Please sign in to comment.