Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit cff2a98

Browse files
author
René Kretzschmar
committed
Replace mock agent by real http.Agent with arbitrary options
1 parent e1e139d commit cff2a98

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/index.test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const http = require('http')
2+
13
const test = require('ava')
24
const fromString = require('from2-string')
35
const { TextHTTPError, JSONHTTPError } = require('micro-api-client')
@@ -12,7 +14,13 @@ const pathPrefix = '/api/v10'
1214
const host = `${domain}:${port}`
1315
const origin = `${scheme}://${host}`
1416
const accessToken = 'testAccessToken'
15-
const agent = { key: 'value' }
17+
const agent = new http.Agent({
18+
keepAlive: true,
19+
keepAliveMsecs: 60000,
20+
maxSockets: 10,
21+
maxFreeSockets: 10,
22+
timeout: 60000
23+
})
1624

1725
const getClient = function(opts = {}) {
1826
return new NetlifyAPI(opts.accessToken, Object.assign({ scheme, host, pathPrefix }, opts))

0 commit comments

Comments
 (0)