Skip to content

Commit fca0c20

Browse files
committed
update circle file
1 parent 66d64b3 commit fca0c20

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.circleci/config.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,15 @@ workflows:
7575
- run: npx nyc report --check-coverage true --lines 100 --include cypress/unit.js
7676

7777
- cypress/run:
78-
# TODO switch to separate example in "examples/..."
7978
name: backend coverage
8079
requires:
8180
- cypress/install
82-
8381
# grab the workspace created by cypress/install job
8482
attach-workspace: true
85-
86-
start: npm run start:test:backend
87-
command: npx cypress run --config-file cypress-backend.json
83+
working_directory: examples/backend
84+
start: npm start
85+
wait-on: 'http://localhost:3003'
86+
command: '../../node_modules/.bin/cypress run'
8887

8988
# there are no jobs to follow this one
9089
# so no need to save the workspace files (saves time)
@@ -94,12 +93,16 @@ workflows:
9493
# you can click on it in the CircleCI UI
9594
# to see live static HTML site
9695
- store_artifacts:
97-
path: coverage
98-
# print code coverage summary to the terminal
99-
# and make sure there the coverage is above certain limit
100-
- run: npx nyc report --check-coverage true --lines 72
101-
# and look at the server index file - should be fully covered
102-
- run: npx nyc report --check-coverage true --lines 100 --include test-backend/index.js
96+
path: examples/backend/coverage
97+
- run:
98+
command: npm run coverage:report
99+
working_directory: examples/backend
100+
- run:
101+
name: Check code coverage 📈
102+
command: |
103+
node ../../scripts/check-coverage server.js
104+
node ../../scripts/only-covered server.js
105+
working_directory: examples/backend
103106

104107
- cypress/run:
105108
attach-workspace: true
@@ -180,7 +183,6 @@ workflows:
180183
- run:
181184
command: npm run coverage:check
182185
working_directory: examples/ts-example
183-
184186
- run:
185187
name: Check code coverage 📈
186188
command: |

examples/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"start": "../../node_modules/.bin/nyc --silent node server/server",
77
"cy:open": "../../node_modules/.bin/cypress open",
88
"dev": "../../node_modules/.bin/start-test 3003 cy:open",
9-
"report": "../../node_modules/.bin/nyc report"
9+
"coverage:report": "../../node_modules/.bin/nyc report"
1010
}
1111
}

0 commit comments

Comments
 (0)