Skip to content

Commit

Permalink
fix: leftover
Browse files Browse the repository at this point in the history
  • Loading branch information
metcoder95 committed Jan 2, 2023
1 parent 9585557 commit 2a3ea3c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 57 deletions.
10 changes: 0 additions & 10 deletions test/client-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,6 @@ test('invalid options throws', (t) => {
t.equal(err.message, 'invalid keepAliveTimeout')
}

try {
new Client(new URL('http://localhost:200'), { // eslint-disable-line
reset: 'asd'
}) // eslint-disable-line
t.fail()
} catch (err) {
t.type(err, errors.InvalidArgumentError)
t.equal(err.message, 'invalid reset')
}

try {
new Client(new URL('http://localhost:200'), { // eslint-disable-line
localAddress: 123
Expand Down
47 changes: 0 additions & 47 deletions test/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,53 +174,6 @@ test('basic get', (t) => {
})
})

test('basic get - with reset to true', (t) => {
t.plan(15)

const server = createServer((req, res) => {
t.equal('/', req.url)
t.equal('GET', req.method)
t.equal(req.headers.connection, 'close')
res.setHeader('content-type', 'text/plain')
res.end('hello')
})
t.teardown(server.close.bind(server))

server.listen(0, async () => {
const client = new Pool(`http://localhost:${server.address().port}`, { reset: true })
t.teardown(client.destroy.bind(client))

t.equal(client[kUrl].origin, `http://localhost:${server.address().port}`)

client.request({ path: '/', method: 'GET' }, (err, { statusCode, headers, body }) => {
t.error(err)
t.equal(statusCode, 200)
t.equal(headers['content-type'], 'text/plain')
const bufs = []
body.on('data', (buf) => {
bufs.push(buf)
})
body.on('end', () => {
t.equal('hello', Buffer.concat(bufs).toString('utf8'))
})
})

t.equal(client.destroyed, false)
t.equal(client.closed, false)
client.close((err) => {
t.error(err)
t.equal(client.destroyed, true)
client.destroy((err) => {
t.error(err)
client.close((err) => {
t.type(err, errors.ClientDestroyedError)
})
})
})
t.equal(client.closed, true)
})
})

test('URL as arg', (t) => {
t.plan(9)

Expand Down

0 comments on commit 2a3ea3c

Please sign in to comment.