Updated test
This commit is contained in:
@ -260,9 +260,9 @@ test('Client close', t => {
|
|||||||
t.plan(2)
|
t.plan(2)
|
||||||
|
|
||||||
class MyConnectionPool extends ConnectionPool {
|
class MyConnectionPool extends ConnectionPool {
|
||||||
empty () {
|
empty (callback) {
|
||||||
t.ok('called')
|
t.ok('called')
|
||||||
super.empty()
|
super.empty(callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,9 +278,9 @@ test('Client close (promise)', t => {
|
|||||||
t.plan(2)
|
t.plan(2)
|
||||||
|
|
||||||
class MyConnectionPool extends ConnectionPool {
|
class MyConnectionPool extends ConnectionPool {
|
||||||
empty () {
|
empty (callback) {
|
||||||
t.ok('called')
|
t.ok('called')
|
||||||
super.empty()
|
super.empty(callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -240,11 +240,12 @@ test('API', t => {
|
|||||||
const pool = new ConnectionPool({ Connection })
|
const pool = new ConnectionPool({ Connection })
|
||||||
pool.addConnection('http://localhost:9200/')
|
pool.addConnection('http://localhost:9200/')
|
||||||
pool.addConnection('http://localhost:9201/')
|
pool.addConnection('http://localhost:9201/')
|
||||||
pool.empty()
|
pool.empty(() => {
|
||||||
t.strictEqual(pool.connections.size, 0)
|
t.strictEqual(pool.connections.size, 0)
|
||||||
t.deepEqual(pool.dead, [])
|
t.deepEqual(pool.dead, [])
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
t.test('urlToHost', t => {
|
t.test('urlToHost', t => {
|
||||||
const pool = new ConnectionPool({ Connection })
|
const pool = new ConnectionPool({ Connection })
|
||||||
|
|||||||
Reference in New Issue
Block a user