Skip to content

Commit c583a26

Browse files
committed
Simpler / more idiomatic use of promises
1 parent 26f2b6a commit c583a26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/fake_report_server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { AddressInfo, Server, Socket } from 'net'
1+
import { Server } from 'net'
22
import express from 'express'
33
import { pipeline, Writable } from 'stream'
44
import http from 'http'
5-
import { promisify } from 'util'
65
import { doesHaveValue } from '../src/value_checker'
76

87
type Callback = (err?: Error | null) => void
@@ -62,8 +61,9 @@ export default class FakeReportServer {
6261
}
6362

6463
async start(): Promise<void> {
65-
const listen = promisify(this.server.listen.bind(this.server))
66-
await listen(this.port)
64+
return new Promise((resolve) =>
65+
this.server.listen(this.port, () => resolve())
66+
)
6767
}
6868

6969
/**

0 commit comments

Comments
 (0)