Skip to content

Commit

Permalink
chore: add localhost lookup test
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 25, 2024
1 parent cea5a1e commit d313c85
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/cli/host-test.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d313c85

Please sign in to comment.