Skip to content

Commit

Permalink
chore: harden custom dns resolver test
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Feb 21, 2024
1 parent fcc5c32 commit 65617a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/verified-fetch/test/verified-fetch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ describe('@helia/verifed-fetch', () => {
const customResolver2 = Sinon.stub()
const onProgress = Sinon.stub()

customResolver1.rejects(new Error('Could not resolve PeerId "mydomain.com"'))
customResolver1.rejects(new Error('fake DNS error'))
customResolver2.returns(Promise.resolve('/ipfs/QmVP2ip92jQuMDezVSzQBWDqWFbp9nyCHNQSiciRauPLDg'))

const verifiedFetch = new VerifiedFetch({
Expand All @@ -543,7 +543,7 @@ describe('@helia/verifed-fetch', () => {

expect(customResolver1.callCount).to.equal(1)
expect(customResolver1.getCall(0).args).to.deep.equal(['mydomain.com', { onProgress }])
await expect(customResolver1.getCall(0).returnValue).to.eventually.be.rejectedWith('Could not resolve PeerId "mydomain.com"')
await expect(customResolver1.getCall(0).returnValue).to.eventually.be.rejectedWith('fake DNS error')
expect(customResolver2.callCount).to.equal(1)
expect(customResolver2.getCall(0).args).to.deep.equal(['mydomain.com', { onProgress }])
})
Expand Down

0 comments on commit 65617a5

Please sign in to comment.