From 39f6ca86642f9a0005f1be4dbc70e7dd5a9e7609 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Sun, 19 Sep 2021 15:05:02 -0400 Subject: [PATCH] Correct method for test --- utils/GunSmith/GunSmith.spec.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/utils/GunSmith/GunSmith.spec.js b/utils/GunSmith/GunSmith.spec.js index 1bb42ed2..5e8e0c2f 100644 --- a/utils/GunSmith/GunSmith.spec.js +++ b/utils/GunSmith/GunSmith.spec.js @@ -431,28 +431,25 @@ describe('gun smith', () => { release() }) - // eslint-disable-next-line jest/expect-expect it('provides an special once() that restarts gun until a value is fetched', async done => { expect.assertions(1) - await whenReady() jest.setTimeout(100000) + await whenReady() const a = words() const b = words() const node = instance.get(a).get(b) const value = words() - node.once(data => { - if (data === value) { - expect(data).toEqual(value) - jest.setTimeout(5000) - done() - release() - } + node.specialOnce(data => { + expect(data).toEqual(value) + + done() + release() }) setTimeout(() => { node.put(value) - }, 9000) + }, 30000) }) })