Skip to content

Commit

Permalink
null number test
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Oct 4, 2020
1 parent b6d4aee commit 768eaf9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/coercion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,19 @@ describe(packageJson.name, () => {
})
.expect(400)
.then((r) => {
console.log(r.body);
expect(r.body.message).to.contain('age should be number');
}));

it('should return 400 when age (number) is null', async () =>
request(app)
.post(`${app.basePath}/coercion/pets`)
.send({
name: 'test',
is_cat: true,
age: null,
})
.expect(400)
.then((r) => {
expect(r.body.message).to.contain('age should be number');
}));

Expand Down

0 comments on commit 768eaf9

Please sign in to comment.