Skip to content

Commit

Permalink
Test response/request.formData() when constructed with empty FormData
Browse files Browse the repository at this point in the history
Closes #28607.
  • Loading branch information
jimmywarting authored May 3, 2021
1 parent d95e406 commit b9e74d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions fetch/api/body/formdata.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
promise_test(async t => {
const res = new Response(new FormData());
const fd = await res.formData();
assert_true(fd instanceof FormData);
}, 'Consume empty response.formData() as FormData');

promise_test(async t => {
const req = new Request('about:blank', {
method: 'POST',
body: new FormData()
});
const fd = await req.formData();
assert_true(fd instanceof FormData);
}, 'Consume empty request.formData() as FormData');

0 comments on commit b9e74d0

Please sign in to comment.