Skip to content

Commit

Permalink
really fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Jan 17, 2025
1 parent ea15e39 commit cf349fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ export class RegistryClient {
this.didMap.set(did, entry)
}
}
resultEntry!.loaded = true
if (resultEntry != null) resultEntry.loaded = true
} catch (e) {
console.log(`Could not load registry from url "${registry.url}":`, e)
// no DIDs are added from that registry
resultEntry!.loaded = false
resultEntry!.error = e
if (resultEntry != null) resultEntry.loaded = false
if (resultEntry != null) resultEntry.error = e
}
}))
return registryLoadResult
Expand Down
9 changes: 6 additions & 3 deletions test/registryClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ describe('registry client', () => {
const client = new RegistryClient()

const result = await client.load({ config: badIssuer })
console.log(result)
expect(result.length).to.equal(2)
expect(result.find(entry => entry.url === 'https://digitalcredentials.github.io/sandbox-registry/registry.json')?.loaded).to.be.true
expect(result.find(entry => entry.url === 'https://digitalcredentials.github.io/community-registry/reggggistry.json')?.loaded).to.be.false

const successfulLoad = result.find(entry => entry.url === 'https://digitalcredentials.github.io/sandbox-registry/registry.json')
expect(successfulLoad?.loaded).to.equal(true)

const failedLoad = result.find(entry => entry.url === 'https://digitalcredentials.github.io/community-registry/reggggistry.json')
expect(failedLoad?.loaded).to.equal(false)

const entry = client
.didEntry('did:key:z6MkpLDL3RoAoMRTwTgo3rs39ZwssfaPKtGdZw7AGRN7CK4W')
Expand Down

0 comments on commit cf349fe

Please sign in to comment.