diff --git a/test/custom-http-server.test.js b/test/custom-http-server.test.js index cb6c9367c3..bf9b02bb09 100644 --- a/test/custom-http-server.test.js +++ b/test/custom-http-server.test.js @@ -10,8 +10,9 @@ const dns = require('dns').promises test('Should support a custom http server', async t => { const localAddresses = await dns.lookup('localhost', { all: true }) + const minPlan = localAddresses.length - 1 || 1 - t.plan((localAddresses.length - 1) + 3) + t.plan(minPlan + 3) const serverFactory = (handler, opts) => { t.ok(opts.serverFactory, 'it is called once for localhost') diff --git a/test/https/custom-https-server.test.js b/test/https/custom-https-server.test.js index 84e5443b9a..87694f9e67 100644 --- a/test/https/custom-https-server.test.js +++ b/test/https/custom-https-server.test.js @@ -12,8 +12,9 @@ t.before(buildCertificate) test('Should support a custom https server', async t => { const localAddresses = await dns.lookup('localhost', { all: true }) + const minPlan = localAddresses.length - 1 || 1 - t.plan((localAddresses.length - 1) + 3) + t.plan(minPlan + 3) const serverFactory = (handler, opts) => { t.ok(opts.serverFactory, 'it is called once for localhost')