Skip to content

Commit

Permalink
test: fix close server
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Feb 8, 2024
1 parent ef81c8a commit ca7f4b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const { default: listen } = require('async-listen')
const { createServer } = require('http')
const { promisify } = require('util')
const test = require('ava')

const got = require('got').extend({
Expand All @@ -21,7 +20,8 @@ const final = (err, req, res) => {
res.end(err ? err.message : 'Not Found')
}

const closeServer = server => promisify(server.close)
const closeServer = server =>
require('util').promisify(server.close.bind(server))()

const runServer = async (t, handler) => {
const server = createServer(handler)
Expand Down

0 comments on commit ca7f4b6

Please sign in to comment.