Helpers: avoid allocating new timers (#1224)

This commit is contained in:
Tomas Della Vedova
2020-06-12 10:43:41 +02:00
committed by GitHub
parent 8e077b46a7
commit 04d082cb49
3 changed files with 13 additions and 15 deletions

View File

@ -637,8 +637,6 @@ test('Flush interval', t => {
test('Flush interval - early stop', t => {
t.plan(3)
const clock = FakeTimers.install({ toFake: ['setTimeout', 'clearTimeout'] })
t.teardown(() => clock.uninstall())
const MockConnection = connection.buildMockConnection({
onRequest (params) {
@ -672,7 +670,6 @@ test('Flush interval - early stop', t => {
})
setImmediate(() => {
clock.next()
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
t.ok(err instanceof errors.ConfigurationError)
})