1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/functional/lib/simple_server.js
Juan Picado @jotadeveloper 9242d498d7
refactor: functional testing
* server now are executed in the jest setup phase
* disable one snapshot
2018-06-23 20:57:16 +02:00

27 lines
500 B
JavaScript

// @flow
import express from 'express';
import bodyParser from 'body-parser';
export default class ExpressServer {
app: any;
server: any;
constructor() {
this.app = express();
this.server;
}
start(port: number): Promise<any> {
return new Promise((resolve) => {
this.app.use(bodyParser.json());
this.app.use(bodyParser.urlencoded({
extended: true
}));
this.server = this.app.listen(port, () => {
resolve(this);
});
});
}
}