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()
|
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)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue