Change test order, avoids undiagnosed race cond

This commit is contained in:
Daniel Lugo 2021-09-21 16:20:43 -04:00
parent 39f6ca8664
commit c992671356

View file

@ -228,6 +228,30 @@ describe('gun smith', () => {
}) })
}) })
it('provides an special once() 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()
node.specialOnce(data => {
expect(data).toEqual(value)
done()
release()
})
setTimeout(() => {
node.put(value)
}, 30000)
})
// 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 => { it('maps over a primitive set', async done => {
expect.assertions(100) expect.assertions(100)
await whenReady() await whenReady()
@ -430,26 +454,4 @@ describe('gun smith', () => {
done() done()
release() release()
}) })
it('provides an special once() 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()
node.specialOnce(data => {
expect(data).toEqual(value)
done()
release()
})
setTimeout(() => {
node.put(value)
}, 30000)
})
}) })