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();
let devServer = null; let devServer = null;
global.startServer = (done) => { global.startServer = (done) => {
app.use('/', express.static(path.resolve(__dirname, '..'))); if (devServer === null) {
devServer = app.listen(3000, done); app.use('/', express.static(path.resolve(__dirname, '..')));
devServer = app.listen(3000, done);
} else {
done();
}
}; };
global.stopServer = (done) => { global.stopServer = (done) => {
devServer.close(done); if (devServer !== null) {
devServer.close(done);
devServer = null;
} else {
done();
}
}; };

Loading…
Cancel
Save