File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,29 @@ import { Application } from 'express';
22import * as request from 'supertest' ;
33import { bootstrapApp , BootstrapSettings } from '../utils/bootstrap' ;
44import { env } from '../../../src/core/env' ;
5- import { synchronizeDatabase } from '../../integration/utils/database' ;
5+ import { synchronizeDatabase , closeDatabase } from '../../integration/utils/database' ;
6+
67
78describe ( '/api' , ( ) => {
89
10+ // -------------------------------------------------------------------------
11+ // Tear up
12+ // -------------------------------------------------------------------------
13+
914 let settings : BootstrapSettings ;
1015 beforeAll ( async ( ) => settings = await bootstrapApp ( ) ) ;
1116 beforeAll ( async ( ) => synchronizeDatabase ( settings . connection ) ) ;
1217
18+ // -------------------------------------------------------------------------
19+ // Tear down
20+ // -------------------------------------------------------------------------
21+
22+ afterAll ( async ( ) => closeDatabase ( settings . connection ) ) ;
23+
24+ // -------------------------------------------------------------------------
25+ // Test cases
26+ // -------------------------------------------------------------------------
27+
1328 test ( 'GET: / should return the api-version' , async ( done ) => {
1429 const response = await request ( settings . app )
1530 . get ( '/api' )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { env } from '../../../src/core/env';
1010import { synchronizeDatabase , closeDatabase } from '../../integration/utils/database' ;
1111import { fakeAuthenticationForUser } from '../utils/auth' ;
1212
13+
1314describe ( '/api/users' , ( ) => {
1415
1516 // -------------------------------------------------------------------------
Original file line number Diff line number Diff line change 1-
2-
31import * as http from 'http' ;
42import { bootstrapMicroframework , Microframework } from 'microframework' ;
53import { Application } from 'express' ;
@@ -15,6 +13,7 @@ import { iocLoader } from './../../../src/loaders/iocLoader';
1513import { graphqlLoader } from './../../../src/loaders/graphqlLoader' ;
1614import { eventDispatchLoader } from './../../../src/loaders/eventDispatchLoader' ;
1715
16+
1817export interface BootstrapSettings {
1918 app : Application ;
2019 server : http . Server ;
You can’t perform that action at this time.
0 commit comments