Correct method for test
This commit is contained in:
parent
92429ecb1e
commit
39f6ca8664
1 changed files with 7 additions and 10 deletions
|
|
@ -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) {
|
||||
node.specialOnce(data => {
|
||||
expect(data).toEqual(value)
|
||||
jest.setTimeout(5000)
|
||||
|
||||
done()
|
||||
release()
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
node.put(value)
|
||||
}, 9000)
|
||||
}, 30000)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue