Skip to content

Commit

Permalink
fix: custom dns-resolvers test passes when sessions=false
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Apr 17, 2024
1 parent 9b87ff1 commit 647b6cb
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/verified-fetch/test/custom-dns-resolvers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ describe('custom dns-resolvers', () => {
gateways: ['http://127.0.0.1:8080'],
dnsResolvers: [customDnsResolver]
})
const response = await fetch('ipns://some-non-cached-domain.com')
const response = await fetch('ipns://some-non-cached-domain.com', { session: false })
expect(response.status).to.equal(502)
expect(response.statusText).to.equal('Bad Gateway')

expect(customDnsResolver.callCount).to.equal(1)
expect(customDnsResolver.getCall(0).args).to.deep.equal(['_dnslink.some-non-cached-domain.com', {
expect(customDnsResolver.getCall(0).args[0]).to.equal('_dnslink.some-non-cached-domain.com')
expect(customDnsResolver.getCall(0).args[1]).to.deep.include({
types: [
RecordType.TXT
]
}])
})
})

it('is used when passed to VerifiedFetch', async () => {
Expand All @@ -61,15 +62,17 @@ describe('custom dns-resolvers', () => {
helia
})

const response = await verifiedFetch.fetch('ipns://some-non-cached-domain2.com')
const response = await verifiedFetch.fetch('ipns://some-non-cached-domain2.com', { session: false })
expect(response.status).to.equal(502)
expect(response.statusText).to.equal('Bad Gateway')

expect(customDnsResolver.callCount).to.equal(1)
expect(customDnsResolver.getCall(0).args).to.deep.equal(['_dnslink.some-non-cached-domain2.com', {

expect(customDnsResolver.getCall(0).args[0]).to.equal('_dnslink.some-non-cached-domain2.com')
expect(customDnsResolver.getCall(0).args[1]).to.deep.include({
types: [
RecordType.TXT
]
}])
})
})
})

0 comments on commit 647b6cb

Please sign in to comment.