smartdns/test/test.js
2016-11-15 22:40:40 +01:00

30 lines
2.2 KiB
JavaScript

"use strict";
require("typings-test");
const should = require("should");
const dnsly = require("../dist/index");
let testDnsly;
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, get a mx record for a domain', function (done) {
testDnsly.getRecord('google.com', 'MX').then(res => {
console.log(res);
done();
}).catch(err => {
console.log(err);
done(err);
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQixpQ0FBZ0M7QUFFaEMsdUNBQXNDO0FBRXRDLElBQUksU0FBc0IsQ0FBQTtBQUUxQixRQUFRLENBQUMsT0FBTyxFQUFFO0lBQ2QsRUFBRSxDQUFDLG9DQUFvQyxFQUFFO1FBQ3JDLFNBQVMsR0FBRyxJQUFJLEtBQUssQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLENBQUE7UUFDckMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFBO0lBQ2hELENBQUMsQ0FBQyxDQUFBO0lBRUYsRUFBRSxDQUFDLHVDQUF1QyxFQUFFLFVBQVUsSUFBSTtRQUN0RCxTQUFTLENBQUMsU0FBUyxDQUFDLFlBQVksRUFBRSxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRztZQUMzQyxPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFBO1lBQ2hCL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