smartdns/test/test.ts

29 lines
680 B
TypeScript
Raw Normal View History

2016-11-15 20:39:21 +00:00
import 'typings-test'
import * as should from 'should'
import * as dnsly from '../dist/index'
let testDnsly: dnsly.Dnsly
describe('dnsly', function () {
it('should create an instance of Dnsly', function () {
testDnsly = new dnsly.Dnsly('google')
should(testDnsly).be.instanceOf(dnsly.Dnsly)
})
it('should, get a dns record for a domain', function (done) {
testDnsly.getRecord('google.com', 'A').then(res => {
console.log(res)
done()
}).catch(err => {
console.log(err)
done(err)
})
})
it('should close the instance', function () {
testDnsly.close()
})
})