Skip to content

Commit

Permalink
Do async testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmywarting committed May 16, 2019
1 parent cf0bddd commit f9d4b20
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,18 @@ window.File = new Proxy(NativeFile, {
})
})

describe('XHR', () => {
it('Shouldn\'t add Content-Type header if already present', async () => {
describe.skip('XHR', () => {
it('Shouldn\'t add Content-Type header if already present', next => {
const formData = createFormData(['key', 'value1'])
const xhr = new XMLHttpRequest()
xhr.open('POST', 'https://httpbin.org/post', false)
xhr.open('POST', 'https://httpbin.org/post')
xhr.setRequestHeader('Content-Type', 'text/plain')
xhr.send(formData);

const response = JSON.parse(xhr.response);
assert.equal(response.headers['Content-Type'], 'text/plain');
xhr.responseType = 'json'
xhr.onload = () => {
assert.equal(xhr.response.headers['Content-Type'], 'text/plain')
next()
}
xhr.send(formData)
})
})
})
Expand Down

0 comments on commit f9d4b20

Please sign in to comment.