Skip to content

Commit

Permalink
Fix test that would always pass
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Hinek <[email protected]>
  • Loading branch information
frankhinek committed Nov 1, 2023
1 parent b865b10 commit e3e2cb6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/dids/tests/did-dht.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ describe('DidDhtMethod', () => {
it('should generate a keyset with an identity keyset passed in (wrong kid)', async () => {
const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({ keyAlgorithm: 'Ed25519' });

expect(DidDhtMethod.generateKeySet({
await expect(DidDhtMethod.generateKeySet({
keySet: { identityKey: ed25519KeyPair }
})).to.be.rejectedWith('The identity key must have a kid of 0');
})).to.eventually.be.rejectedWith('The identity key must have a kid of 0');
});

it('should generate a keyset with an identity keyset passed in (correct kid)', async () => {
Expand Down Expand Up @@ -106,7 +106,7 @@ describe('DidDhtMethod', () => {
});

it('should create a did document without options', async () => {
const {document, keySet} = await DidDhtMethod.create();
const { document, keySet } = await DidDhtMethod.create();

expect(document).to.exist;
expect(document.id).to.contain('did:dht:');
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('DidDhtMethod', () => {
};

const keySet = await DidDhtMethod.generateKeySet({ keySet: { verificationMethodKeys: [vm] }});
const {document} = await DidDhtMethod.create({keySet});
const { document } = await DidDhtMethod.create({ keySet });

expect(document).to.exist;
expect(document.id).to.contain('did:dht:');
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('DidDhtMethod', () => {
type : 'agent',
serviceEndpoint : 'https://example.com/agent'
}];
const {document} = await DidDhtMethod.create({ services });
const { document } = await DidDhtMethod.create({ services });

expect(document).to.exist;
expect(document.id).to.contain('did:dht:');
Expand Down Expand Up @@ -239,4 +239,4 @@ describe('DidDhtMethod', () => {
expect(resolvedDocument.verificationMethod[0].publicKeyJwk.kid).to.deep.equal(document.verificationMethod[0].publicKeyJwk.kid);
});
});
});
});

0 comments on commit e3e2cb6

Please sign in to comment.