Test for specialThen()

This commit is contained in:
Daniel Lugo 2021-09-22 10:38:45 -04:00
parent c992671356
commit a21f949a79

View file

@ -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 => {