Skip to content

Commit 8e36e5c

Browse files
committed
chore: test
1 parent e8795e9 commit 8e36e5c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

packages/dnslink/test/index.spec.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,4 +382,31 @@ describe('dnslink', () => {
382382

383383
expect(result).to.have.deep.nested.property('[0].cid', CID.parse('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'))
384384
})
385+
386+
it('should resolve multiple recursive DNSLink names', async () => {
387+
dns.query.withArgs('_dnslink.foobar.baz').resolves(dnsResponse([{
388+
name: '_dnslink.foobar.baz.',
389+
TTL: 60,
390+
type: RecordType.TXT,
391+
data: 'dnslink=/ipns/qux.quux'
392+
}, {
393+
name: '_dnslink.foobar.baz.',
394+
TTL: 60,
395+
type: RecordType.TXT,
396+
// spellchecker:disable-next-line
397+
data: 'dnslink=/ipfs/bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe'
398+
}]))
399+
400+
dns.query.withArgs('_dnslink.qux.quux').resolves(dnsResponse([{
401+
name: '_dnslink.qux.quux.',
402+
TTL: 60,
403+
type: RecordType.TXT,
404+
data: 'dnslink=/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'
405+
}]))
406+
407+
const result = await name.resolve('foobar.baz')
408+
409+
expect(result).to.have.deep.nested.property('[0].cid', CID.parse('bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe'))
410+
expect(result).to.have.deep.nested.property('[1].cid', CID.parse('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'))
411+
})
385412
})

0 commit comments

Comments
 (0)