mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 01:22:54 +00:00
feat: utilize api-cli for e2e integration test
This commit is contained in:
committed by
Rainer Killinger
parent
bbbe4d5f1f
commit
ce06e735be
23
src/app.ts
23
src/app.ts
@@ -44,8 +44,29 @@ import {Elasticsearch} from './storage/elasticsearch/elasticsearch';
|
||||
* Configure the backend
|
||||
*/
|
||||
export async function configureApp(app: Express) {
|
||||
let integrationTestTimeout: NodeJS.Timeout;
|
||||
// request loggers have to be the first middleware to be set in express
|
||||
app.use(morgan('dev'));
|
||||
app.use(morgan('dev', {
|
||||
skip: (_req, res) => {
|
||||
if (process.env.NODE_ENV === 'integration-test') {
|
||||
clearTimeout(integrationTestTimeout);
|
||||
integrationTestTimeout = setTimeout(() => {
|
||||
process.exit(1);
|
||||
},
|
||||
// tslint:disable-next-line:no-magic-numbers
|
||||
20000);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// tslint:disable-next-line: no-magic-numbers
|
||||
if (res.statusCode < 400) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}, stream: process.stdout,
|
||||
}));
|
||||
|
||||
const corsOptions = {
|
||||
allowedHeaders: [
|
||||
|
||||
Reference in New Issue
Block a user