File tree 3 files changed +44
-2
lines changed
3 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,8 @@ npm-debug.log
13
13
/quick-start
14
14
15
15
# tests
16
- /test
17
16
/coverage
18
17
/.nyc_output
19
18
20
19
# dist
21
- /dist
20
+ /dist
Original file line number Diff line number Diff line change
1
+ {
2
+ "moduleFileExtensions" : [
3
+ " js" ,
4
+ " json" ,
5
+ " ts"
6
+ ],
7
+ "rootDir" : " ." ,
8
+ "testEnvironment" : " node" ,
9
+ "testRegex" : " .e2e-spec.ts$" ,
10
+ "transform" : {
11
+ "^.+\\ .(t|j)s$" : " ts-jest"
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ import { INestApplication } from '@nestjs/common' ;
2
+ import { Test } from '@nestjs/testing' ;
3
+ import * as request from 'supertest' ;
4
+ import { ApplicationModule } from '../src/app.module' ;
5
+
6
+ describe ( 'Photos (e2e)' , ( ) => {
7
+ let app : INestApplication ;
8
+
9
+ beforeAll ( async ( ) => {
10
+ const moduleFixture = await Test . createTestingModule ( {
11
+ imports : [ ApplicationModule ] ,
12
+ } ) . compile ( ) ;
13
+ app = moduleFixture . createNestApplication ( ) ;
14
+ await app . init ( ) ;
15
+ } ) ;
16
+
17
+ afterAll ( async ( ) => {
18
+ if ( app ) {
19
+ await app . close ( ) ;
20
+ }
21
+ } ) ;
22
+
23
+ it ( 'should return an empty list of photos' , async ( ) => {
24
+ await request ( app . getHttpServer ( ) )
25
+ . get ( '/photo' )
26
+ . expect ( 200 )
27
+ . expect ( res => expect ( res . body )
28
+ . toEqual ( [ ] ) ) ;
29
+ } ) ;
30
+ } ) ;
You can’t perform that action at this time.
0 commit comments