Skip to content

Commit 49297ad

Browse files
authored
refactor: use latest API methods (#3810)
1 parent e77a41b commit 49297ad

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

test/helpers/test-server.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,7 @@ function startFullSetup(config, options, done) {
2020

2121
server = new Server(options, compiler);
2222

23-
let port;
24-
25-
if (Object.prototype.hasOwnProperty.call(options, "port")) {
26-
port = options.port;
27-
} else {
28-
console.warn("Using the default port for testing is not recommended");
29-
port = 8080;
30-
}
31-
32-
let host;
33-
34-
if (Object.prototype.hasOwnProperty.call(options, "host")) {
35-
host = options.host;
36-
} else {
37-
host = "localhost";
38-
}
39-
40-
server.listen(port, host, (error) => {
23+
server.startCallback((error) => {
4124
if (error && done) {
4225
return done(error);
4326
}
@@ -97,7 +80,7 @@ function start(config, options, done) {
9780

9881
function close(done) {
9982
if (server) {
100-
server.close(() => {
83+
server.stopCallback(() => {
10184
server = null;
10285
done();
10386
});

0 commit comments

Comments
 (0)