BREAKING CHANGE(core): now uses Google DNS HTTPS API and handles DNSSEC validation

This commit is contained in:
2020-02-15 16:41:37 +00:00
parent d0527affc2
commit 929e4152d3
11 changed files with 1063 additions and 757 deletions

View File

@ -5,7 +5,7 @@ import * as smartdns from '../ts/index';
let testDnsly: smartdns.Smartdns;
tap.test('should create an instance of Dnsly', async () => {
testDnsly = new smartdns.Smartdns('cloudflare');
testDnsly = new smartdns.Smartdns({});
expect(testDnsly).to.be.instanceOf(smartdns.Smartdns);
});
@ -14,6 +14,7 @@ tap.test('should get an A DNS Record', async () => {
{
name: 'dnsly_a.bleu.de',
value: '127.0.0.1',
dnsSecEnabled: false,
type: 'A'
}
]);
@ -24,6 +25,7 @@ tap.test('should get an AAAA Record', async () => {
{
name: 'dnsly_aaaa.bleu.de',
value: '::1',
dnsSecEnabled: false,
type: 'AAAA'
}
]);
@ -32,10 +34,10 @@ tap.test('should get an AAAA Record', async () => {
tap.test('should get a txt record', async () => {
return expect(testDnsly.getRecordTxt('dnsly_txt.bleu.de')).to.eventually.deep.equal([
{
chunked: ['sometext_txt'],
name: 'dnsly_txt.bleu.de',
value: 'sometext_txt',
type: 'TXT'
type: 'TXT',
dnsSecEnabled: false
}
]);
});
@ -65,4 +67,10 @@ tap.test('should get name server for hostname', async () => {
console.log(result);
});
tap.test('should detect dns sec', async () => {
const result = await testDnsly.getRecordA('lossless.com');
console.log(result[0]);
expect(result[0].dnsSecEnabled).to.be.true;
})
tap.start();