Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken test #99

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/protocol/src/did-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export const DidResolver = new Web5DidResolver({
* @beta
*/
export async function resolveDid(did: string): Promise<DidDocument> {
console.log(`resolving did ${did}`)
const { didResolutionMetadata, didDocument } = await DidResolver.resolve(did)
console.log(`yayy we resolved`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line never prints


// TODO: remove the '?' after we ask OSE peeps about why DID ION resolution doesn't return didResolutionMetadata
// despite being required as per the did-core spec
Expand Down
16 changes: 16 additions & 0 deletions packages/protocol/tests/did-resolver.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { expect } from 'chai'
import { resolveDid } from '../src/did-resolver.js'
import { DidDhtMethod } from '@web5/dids'

describe('Did Resolver', () => {
describe('resolveDid', () => {
it.only('resolves did:dht', async () => {
const did = await DidDhtMethod.create()
const resolutionResult = await resolveDid(did.did)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test output:

1) Did Resolver
       resolveDid
         resolves did:dht:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/plew/Development/tbdex-js/packages/protocol/tests/compiled/tests/did-resolver.spec.js)
      at listOnTimeout (node:internal/timers:573:17)
      at process.processTimers (node:internal/timers:514:7)
      ```


console.log(JSON.stringify(resolutionResult, null, 2))
expect(resolutionResult.id).to.equal(did.did)
})
})
})

Loading