Skip to content

Commit 0ef55c0

Browse files
committed
Added another test case when a message is undefined
1 parent 547615a commit 0ef55c0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/common/test/exceptions/http.exception.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ describe('HttpException', () => {
2525
});
2626
});
2727

28+
it('should return an object even when the message is undefined', () => {
29+
expect(new BadRequestException().message).to.be.eql({statusCode: 400, error: 'Bad Request'});
30+
});
31+
2832
it('should return a status code', () => {
2933
expect(new BadRequestException().getStatus()).to.be.eql(400);
3034
expect(new NotFoundException().getStatus()).to.be.eql(404);

0 commit comments

Comments
 (0)