diff --git a/cloudron.js b/cloudron.js index 7650567..fb3daa7 100644 --- a/cloudron.js +++ b/cloudron.js @@ -263,7 +263,7 @@ Cloudron.prototype.checkA = function (callback) { if (records[0] !== that._box.ip) return callback(new Error('Bad A record. ' + records[0] + '. Expecting ' + that._box.ip)); - callback(); + callback(null, records); }); }; @@ -275,7 +275,7 @@ Cloudron.prototype.checkSPF = function (callback) { if (records[0][0].search(new RegExp('^v=spf1 ip4:' + that._box.ip + ' ~all$')) !== 0) return callback(new Error('Bad SPF record. ' + records[0][0])); - callback(); + callback(null, records); }); }; @@ -287,7 +287,7 @@ Cloudron.prototype.checkDKIM = function (callback) { // node removes the quotes or maybe this is why a 2d-array? if (records[0][0].search(/^v=DKIM1; t=s; p=.*$/) !== 0) return callback(new Error('Bad DKIM record. ' + records[0][0])); - callback(); + callback(null, records); }); }; @@ -299,7 +299,7 @@ Cloudron.prototype.checkDMARC = function (callback) { // node removes the quotes or maybe this is why a 2d-array? if (records[0][0].search(/^v=DMARC1; p=none; pct=100; rua=mailto:.*; ruf=.*$/) !== 0) return callback(new Error('Bad DMARC record. ' + records[0][0])); - callback(); + callback(null, records); }); }; diff --git a/test/new-user-test.js b/test/new-user-test.js index 675493c..f395ed6 100644 --- a/test/new-user-test.js +++ b/test/new-user-test.js @@ -99,11 +99,13 @@ describe('Appstore new user flow', function () { }); it('has setup DNS records cleaned up', function (done) { - dns.setServers([ '8.8.8.8' ]); // use different dns server so as to not get cached results + dns.setServers([ '205.251.199.12' ]); // use different dns server so as to not get cached results function expectError(tag, fn) { return function (cb) { - fn(function (error) { + fn(function (error, records) { + if (!error) console.error('Records of %s is %j', tag, records); + cb(error ? null : new Error('Expecting error for ' + tag)); }); };