Skip to content

Commit

Permalink
Test formData body consumption.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgraham committed Nov 24, 2014
1 parent 42c5497 commit 4a7e655
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,17 @@ asyncTest('rejects text promise after body is consumed', 2, function() {
})
})

asyncTest('rejects formData promise after body is consumed', 2, function() {
fetch('/json').then(function(response) {
response.formData()
return response.formData()
}).catch(function(error) {
ok(error instanceof TypeError, 'Promise rejected after body consumed')
ok(error.message === 'Body already consumed', 'Promise rejected for incorrect reason')
start()
})
})

asyncTest('supports HTTP PUT', 2, function() {
fetch('/request', {
method: 'put',
Expand Down

0 comments on commit 4a7e655

Please sign in to comment.