Correct method for test

This commit is contained in:
Daniel Lugo 2021-09-19 15:05:02 -04:00
parent 92429ecb1e
commit 39f6ca8664

View file

@ -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)
})
})