Skip to content

Commit

Permalink
test: adjust test to v18
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS committed Apr 22, 2022
1 parent d8e9f8c commit dd5e314
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/listen.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { test, before } = require('tap')
const dns = require('dns').promises
const dnsCb = require('dns')
const sget = require('simple-get').concat
const semver = require('semver')
const Fastify = require('..')

let localhost
Expand Down Expand Up @@ -371,7 +372,9 @@ test('addresses getter', async t => {
const localAddresses = await dns.lookup('localhost', { all: true })
for (const address of localAddresses) {
address.port = port
address.family = 'IPv' + address.family
if (semver.lt(process.versions.node, '18.0.0')) {
address.family = 'IPv' + address.family
}
}
localAddresses.sort((a, b) => a.address.localeCompare(b.address))
t.same(app.addresses().sort((a, b) => a.address.localeCompare(b.address)), localAddresses, 'after listen')
Expand Down

0 comments on commit dd5e314

Please sign in to comment.