2019-08-28 23:15:09 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const { test } = require('tap')
|
|
|
|
const purge = require('../../../../lib/client/request-queue/purge')
|
|
|
|
|
|
|
|
test('flushes the queue with timeout errors', async t => {
|
|
|
|
t.plan(3)
|
|
|
|
const q = {
|
|
|
|
flush (func) {
|
|
|
|
func('a', 'b', 'c', (err) => {
|
|
|
|
t.ok(err)
|
2021-04-05 05:34:59 +00:00
|
|
|
t.equal(err.name, 'TimeoutError')
|
|
|
|
t.equal(err.message, 'request queue timeout')
|
2019-08-28 23:15:09 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
purge.call(q)
|
|
|
|
})
|