Browse Source

Update test server

pull/265/head
Jerome Wu 6 years ago
parent
commit
b4c6565acf
  1. 15
      scripts/test-helper.js

15
scripts/test-helper.js

@ -8,10 +8,19 @@ const app = express(); @@ -8,10 +8,19 @@ const app = express();
let devServer = null;
global.startServer = (done) => {
app.use('/', express.static(path.resolve(__dirname, '..')));
devServer = app.listen(3000, done);
if (devServer === null) {
app.use('/', express.static(path.resolve(__dirname, '..')));
devServer = app.listen(3000, done);
} else {
done();
}
};
global.stopServer = (done) => {
devServer.close(done);
if (devServer !== null) {
devServer.close(done);
devServer = null;
} else {
done();
}
};

Loading…
Cancel
Save