Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhut committed May 9, 2020
1 parent 69dc8a4 commit c414de6
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ test('Method', t => axiosServer(t)

test('Query String', t => axiosServer(t)
.then(axios => axios.get('/get', { params: { foo: 'bar' } })
.then(response => t.is(response.data.args.foo, 'bar'))))
.then(response => t.is(response.data.args.foo, 'bar'))))

test('Request Header', t => axiosServer(t)
.then(axios => axios.get('/headers', { headers: { 'x-foo': 'bar' } })
.then(axios => axios.get('/headers', { headers: { 'x-foo': 'bar' } })
.then(response => t.is(response.data.headers['X-Foo'], 'bar'))))

test('Request Body', t => axiosServer(t)
Expand Down Expand Up @@ -82,7 +82,7 @@ test('with untrusted request body', t => {
app.use(kroxy())
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => t.not(response.data.data, 'foo')))
.then(response => t.not(response.data.data, 'foo')))
})

test('with request body (null)', t => {
Expand All @@ -94,7 +94,7 @@ test('with request body (null)', t => {
app.use(kroxy({ trustRequestBody: true }))
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => t.false('bar' in response.data.form)))
.then(response => t.false('bar' in response.data.form)))
})

test('with request body (string)', t => {
Expand All @@ -107,10 +107,10 @@ test('with request body (string)', t => {
app.use(kroxy({ trustRequestBody: true }))
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => {
t.is(response.data.headers['Content-Type'], 'text/plain;charset=utf-8')
t.is(response.data.data, 'foo')
}))
.then(response => {
t.is(response.data.headers['Content-Type'], 'text/plain;charset=utf-8')
t.is(response.data.data, 'foo')
}))
})

test('with request body (string), keep content type', t => {
Expand All @@ -122,9 +122,9 @@ test('with request body (string), keep content type', t => {
app.use(kroxy({ trustRequestBody: true }))
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => {
t.is(response.data.form.bar, '2')
}))
.then(response => {
t.is(response.data.form.bar, '2')
}))
})

test('with request body (buffer)', t => {
Expand All @@ -136,7 +136,7 @@ test('with request body (buffer)', t => {
app.use(kroxy({ trustRequestBody: true }))
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => t.is(response.data.form.bar, '3')))
.then(response => t.is(response.data.form.bar, '3')))
})

test('with request body (stream)', t => {
Expand All @@ -149,7 +149,7 @@ test('with request body (stream)', t => {
app.use(kroxy({ trustRequestBody: true }))
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => t.is(response.data.form.bar, '4')))
.then(response => t.is(response.data.form.bar, '4')))
})

test('with request body (JSON)', t => {
Expand All @@ -162,7 +162,7 @@ test('with request body (JSON)', t => {
app.use(kroxy({ trustRequestBody: true }))
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => t.is(response.data.json.bar, 5)))
.then(response => t.is(response.data.json.bar, 5)))
})

test('with request body (JSON), keep content type', t => {
Expand All @@ -174,7 +174,7 @@ test('with request body (JSON), keep content type', t => {
app.use(kroxy({ trustRequestBody: true }))
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => t.is(response.data.form['{"bar":"'], '5"}')))
.then(response => t.is(response.data.form['{"bar":"'], '5"}')))
})

test('do not parse response body', t => {
Expand All @@ -186,7 +186,7 @@ test('do not parse response body', t => {
app.use(kroxy())
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => t.is(response.data.form.bar, '1')))
.then(response => t.is(response.data.form.bar, '1')))
})

test('parse and modify response body', t => {
Expand All @@ -200,7 +200,7 @@ test('parse and modify response body', t => {
app.use(kroxy({ parseResponseBody: true }))
return axiosServer(t, app)
.then(axios => axios.post('/post', 'bar=1')
.then(response => t.is(response.data.form.bar, '2')))
.then(response => t.is(response.data.form.bar, '2')))
})

test('parse gzipped response body', t => {
Expand Down

0 comments on commit c414de6

Please sign in to comment.