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() release()
}) })
// eslint-disable-next-line jest/expect-expect
it('provides an special once() that restarts gun until a value is fetched', async done => { it('provides an special once() that restarts gun until a value is fetched', async done => {
expect.assertions(1) expect.assertions(1)
await whenReady()
jest.setTimeout(100000) jest.setTimeout(100000)
await whenReady()
const a = words() const a = words()
const b = words() const b = words()
const node = instance.get(a).get(b) const node = instance.get(a).get(b)
const value = words() const value = words()
node.once(data => { node.specialOnce(data => {
if (data === value) {
expect(data).toEqual(value) expect(data).toEqual(value)
jest.setTimeout(5000)
done() done()
release() release()
}
}) })
setTimeout(() => { setTimeout(() => {
node.put(value) node.put(value)
}, 9000) }, 30000)
}) })
}) })