Skip to content

Commit 759fd6a

Browse files
committed
test: include unset body check
Added a check for unset body on the test "should ignore JSON empty body"
1 parent ec12ab9 commit 759fd6a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ test('should ignore JSON empty body', async () => {
3131
res.end(JSON.stringify({ok: true}));
3232
})
3333

34+
// Empty string body
3435
await makeFetch(server)('/', {
3536
body: '',
3637
method: 'POST',
@@ -39,6 +40,15 @@ test('should ignore JSON empty body', async () => {
3940
'Content-Type': 'application/json',
4041
},
4142
}).expect(200, { ok: true })
43+
44+
// Unset body
45+
await makeFetch(server)('/', {
46+
method: 'POST',
47+
headers: {
48+
Accept: 'application/json',
49+
'Content-Type': 'application/json',
50+
},
51+
}).expect(200, { ok: true })
4252
})
4353

4454
test('should parse json body with no content-type headers', async () => {

0 commit comments

Comments
 (0)