From 01c76a291fbc865230a2e4d99b4c5327d086f5d5 Mon Sep 17 00:00:00 2001 From: gabe Date: Wed, 1 Nov 2023 08:45:40 -0700 Subject: [PATCH] more waits --- packages/dids/tests/did-dht.spec.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/dids/tests/did-dht.spec.ts b/packages/dids/tests/did-dht.spec.ts index 192f0cb53..920ab655e 100644 --- a/packages/dids/tests/did-dht.spec.ts +++ b/packages/dids/tests/did-dht.spec.ts @@ -211,6 +211,10 @@ describe('did-dht', () => { expect(didResolutionResult.didDocument.verificationMethod[0].publicKeyJwk.kid).to.equal('0'); expect(didResolutionResult.didDocument.service).to.not.exist; + // wait for propagation + const wait = ms => new Promise(resolve => setTimeout(resolve, ms)); + await wait(1000*10); + const gotDid = await DidDhtMethod.resolve(document.id); expect(gotDid.id).to.deep.equal(document.id); expect(gotDid.service).to.deep.equal(document.service); @@ -222,6 +226,11 @@ describe('did-dht', () => { it('should create with publish and get a did document', async () => { const {document} = await DidDhtMethod.create({publish: true}); + + // wait for propagation + const wait = ms => new Promise(resolve => setTimeout(resolve, ms)); + await wait(1000*10); + const gotDid = await DidDhtMethod.resolve(document.id); expect(gotDid.id).to.deep.equal(document.id); expect(gotDid.service).to.deep.equal(document.service);