diff --git a/test/node/lookup.js b/test/node/lookup.js index 0958d5ba3..0eafef210 100644 --- a/test/node/lookup.js +++ b/test/node/lookup.js @@ -2,20 +2,25 @@ const assert = require('assert'); const dns = require('dns'); const request = require('../support/client'); -const setup = require('../support/setup'); +const getSetup = require('../support/setup'); -const base = setup.uri; +let base = null; function myLookup(hostname, options, callback) { dns.lookup(hostname, options, callback); } describe('req.lookup()', () => { - it('should set a custom lookup', () => { + before(async () => { + const setup = await getSetup(); + base = setup.uri; + }); + it('should set a custom lookup', (done) => { const r = request.get(`${base}/ok`).lookup(myLookup); assert(r.lookup() === myLookup); r.then((res) => { res.text.should.equal('ok'); + done(); }); }); });