Skip to content

Commit 8097d06

Browse files
authored
Updated deps, droppped Node 8 (#77)
1 parent 6c06a4d commit 8097d06

File tree

3 files changed

+11
-50
lines changed

3 files changed

+11
-50
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22

33
node_js:
4+
- "13"
45
- "12"
56
- "10"
6-
- "8"

package.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,18 @@
3030
"express": "^4.16.4",
3131
"express-http-proxy": "^1.5.0",
3232
"fastify": "^2.0.0",
33-
"got": "^9.5.0",
33+
"got": "^10.0.0",
3434
"http-errors": "^1.7.1",
3535
"http-proxy": "^1.17.0",
3636
"make-promises-safe": "^5.0.0",
3737
"pre-commit": "^1.2.2",
3838
"simple-get": "^3.0.3",
3939
"snazzy": "^8.0.0",
4040
"standard": "^14.0.2",
41-
"tap": "^12.6.6",
41+
"tap": "^14.0.0",
4242
"typescript": "^3.4.5"
4343
},
44-
"peerDependencies": {
45-
"fastify": "2.x"
46-
},
4744
"dependencies": {
4845
"fastify-reply-from": "^2.0.0"
49-
},
50-
"greenkeeper": {
51-
"ignore": [
52-
"tap",
53-
"got"
54-
]
5546
}
5647
}

test/test.js

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ async function run () {
103103
const resultRoot = await got(
104104
`http://localhost:${server.server.address().port}/this-has-data`,
105105
{
106-
body: { hello: 'world' },
107-
json: true
106+
method: 'POST',
107+
json: { hello: 'world' },
108+
responseType: 'json'
108109
}
109110
)
110111
t.deepEqual(resultRoot.body, { something: 'posted' })
@@ -126,7 +127,7 @@ async function run () {
126127
try {
127128
await got(`http://localhost:${server.server.address().port}`)
128129
} catch (err) {
129-
t.equal(err.statusCode, 401)
130+
t.equal(err.response.statusCode, 401)
130131
errored = true
131132
}
132133
t.ok(errored)
@@ -135,7 +136,7 @@ async function run () {
135136
try {
136137
await got(`http://localhost:${server.server.address().port}/a`)
137138
} catch (err) {
138-
t.equal(err.statusCode, 401)
139+
t.equal(err.response.statusCode, 401)
139140
errored = true
140141
}
141142
t.ok(errored)
@@ -159,38 +160,7 @@ async function run () {
159160
try {
160161
await got(`http://localhost:${server.server.address().port}`)
161162
} catch (err) {
162-
t.equal(err.statusCode, 401)
163-
errored = true
164-
}
165-
t.ok(errored)
166-
})
167-
168-
test('beforeHandler(deprecated)', async t => {
169-
const server = Fastify()
170-
server.register(proxy, {
171-
upstream: `http://localhost:${origin.server.address().port}`,
172-
async beforeHandler (request, reply) {
173-
throw new Unauthorized()
174-
}
175-
})
176-
177-
await server.listen(0)
178-
t.tearDown(server.close.bind(server))
179-
180-
var errored = false
181-
try {
182-
await got(`http://localhost:${server.server.address().port}`)
183-
} catch (err) {
184-
t.equal(err.statusCode, 401)
185-
errored = true
186-
}
187-
t.ok(errored)
188-
189-
errored = false
190-
try {
191-
await got(`http://localhost:${server.server.address().port}/a`)
192-
} catch (err) {
193-
t.equal(err.statusCode, 401)
163+
t.equal(err.response.statusCode, 401)
194164
errored = true
195165
}
196166
t.ok(errored)
@@ -300,8 +270,8 @@ async function run () {
300270
} = await got(
301271
`http://localhost:${proxyServer.server.address().port}/api/this-has-data`,
302272
{
303-
body: { hello: 'world' },
304-
json: true
273+
method: 'POST',
274+
json: { hello: 'world' }
305275
}
306276
)
307277
t.equal(location, '/api/something')

0 commit comments

Comments
 (0)