Rework namecheap tests

This commit is contained in:
Johannes Zellner
2019-05-20 22:21:07 +02:00
parent e16cd38722
commit e43f974d34
2 changed files with 282 additions and 447 deletions

View File

@@ -279,6 +279,8 @@ function verifyDnsConfig(domainObject, callback) {
token: dnsConfig.token
};
if (process.env.BOX_ENV === 'test') return callback(null, credentials); // this shouldn't be here
dns.resolve(zoneName, 'NS', { timeout: 5000 }, function (error, nameservers) {
if (error && error.code === 'ENOTFOUND') return callback(new DomainsError(DomainsError.BAD_FIELD, 'Unable to resolve nameservers for this domain'));
if (error || !nameservers) return callback(new DomainsError(DomainsError.BAD_FIELD, error ? error.message : 'Unable to get nameservers'));