diff --git a/test/cli/host-test.js b/test/cli/host-test.js index 780c6bc..e8ce607 100644 --- a/test/cli/host-test.js +++ b/test/cli/host-test.js @@ -1,4 +1,5 @@ const os = require('os') +const dns = require('dns') let { test, fail, comment } = require('tap') const { serve } = require('./common') const port = 1338 @@ -67,6 +68,15 @@ function checkConnections (t, req, canConnect) { } } +test('localhost resolution', (t) => { + dns.lookup('localhost', (err, address, family) => { + t.error(err) + t.equal('127.0.0.1', address) + t.equal(4, family) + t.end() + }) +}) + testServer( 'Listening on all ports by default', [], null,