File tree 5 files changed +30
-1
lines changed
5 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,18 @@ RUN yarn install --frozen-lockfile
12
12
COPY . .
13
13
CMD [ "yarn" , "start:dev" ]
14
14
15
+ FROM dev AS test
16
+ ENV NODE_ENV=test
17
+ CMD [ "yarn" , "test" ]
18
+
19
+ FROM test AS test-cov
20
+ CMD [ "yarn" , "test:cov" ]
21
+
22
+ FROM test AS test-watch
23
+ ENV GIT_WORK_TREE=/app GIT_DIR=/app/.git
24
+ RUN apk add git
25
+ CMD [ "yarn" , "test:watch" ]
26
+
15
27
FROM base AS prod
16
28
ENV NODE_ENV=production
17
29
RUN yarn install --frozen-lockfile --production
Original file line number Diff line number Diff line change 19
19
"test:cov" : " STAGE=dev jest --coverage" ,
20
20
"test:debug" : " node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand" ,
21
21
"test:e2e" : " jest --config ./test/jest-e2e.json" ,
22
- "docker-compose:dev" : " docker-compose up --build"
22
+ "docker-compose:dev" : " docker-compose up --build" ,
23
+ "docker-compose:test" : " docker-compose -f docker-compose.yml -f test.yml up --build --exit-code-from app" ,
24
+ "docker-compose:test:watch" : " docker-compose -f docker-compose.yml -f test-watch.yml up --build" ,
25
+ "docker-compose:test:cov" : " docker-compose -f docker-compose.yml -f test-cov.yml up --build"
23
26
},
24
27
"dependencies" : {
25
28
"@nestjs/common" : " ^8.0.0" ,
Original file line number Diff line number Diff line change
1
+ services :
2
+ app :
3
+ build :
4
+ target : test-cov
Original file line number Diff line number Diff line change
1
+ services :
2
+ app :
3
+ build :
4
+ target : test-watch
5
+ volumes :
6
+ - .git:/app/.git/
Original file line number Diff line number Diff line change
1
+ services :
2
+ app :
3
+ build :
4
+ target : test
You can’t perform that action at this time.
0 commit comments