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

Commit

Permalink
Replace mock agent by real http.Agent with arbitrary options
Browse files Browse the repository at this point in the history
  • Loading branch information
rkretzschmarkaiser committed Apr 27, 2020
1 parent e1e139d commit cff2a98
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const http = require('http')

const test = require('ava')
const fromString = require('from2-string')
const { TextHTTPError, JSONHTTPError } = require('micro-api-client')
Expand All @@ -12,7 +14,13 @@ const pathPrefix = '/api/v10'
const host = `${domain}:${port}`
const origin = `${scheme}://${host}`
const accessToken = 'testAccessToken'
const agent = { key: 'value' }
const agent = new http.Agent({
keepAlive: true,
keepAliveMsecs: 60000,
maxSockets: 10,
maxFreeSockets: 10,
timeout: 60000
})

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

0 comments on commit cff2a98

Please sign in to comment.