Test for specialThen()
This commit is contained in:
parent
c992671356
commit
a21f949a79
1 changed files with 21 additions and 0 deletions
|
|
@ -250,6 +250,27 @@ describe('gun smith', () => {
|
|||
}, 30000)
|
||||
})
|
||||
|
||||
it('provides an special then() that restarts gun until a value is fetched', async done => {
|
||||
expect.assertions(1)
|
||||
jest.setTimeout(100000)
|
||||
await whenReady()
|
||||
|
||||
const a = words()
|
||||
const b = words()
|
||||
const node = instance.get(a).get(b)
|
||||
const value = words()
|
||||
|
||||
setTimeout(() => {
|
||||
node.put(value)
|
||||
}, 30000)
|
||||
|
||||
const res = await node.specialThen()
|
||||
|
||||
expect(res).toBe(value)
|
||||
done()
|
||||
release()
|
||||
})
|
||||
|
||||
// TODO: find out why this test fucks up the previous one if it runs before
|
||||
// that one
|
||||
it('maps over a primitive set', async done => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue