Skip to content

Commit ddabcb7

Browse files
committed
add circle job
1 parent 9416a81 commit ddabcb7

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.circleci/config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,38 @@ workflows:
104104
node ../../scripts/only-covered server.js
105105
working_directory: examples/backend
106106

107+
- cypress/run:
108+
name: fullstack coverage
109+
requires:
110+
- cypress/install
111+
# grab the workspace created by cypress/install job
112+
attach-workspace: true
113+
working_directory: examples/fullstack
114+
start: npm start
115+
wait-on: 'http://localhost:3003'
116+
command: '../../node_modules/.bin/cypress run'
117+
118+
# there are no jobs to follow this one
119+
# so no need to save the workspace files (saves time)
120+
no-workspace: true
121+
post-steps:
122+
# store the created coverage report folder
123+
# you can click on it in the CircleCI UI
124+
# to see live static HTML site
125+
- store_artifacts:
126+
path: examples/backend/coverage
127+
- run:
128+
command: npm run report
129+
working_directory: examples/fullstack
130+
- run:
131+
name: Check code coverage 📈
132+
command: |
133+
node ../../scripts/check-coverage server.js
134+
node ../../scripts/check-coverage main.js
135+
node ../../scripts/check-coverage string-utils.js
136+
node ../../scripts/only-covered server.js main.js string-utils.js
137+
working_directory: examples/fullstack
138+
107139
- cypress/run:
108140
attach-workspace: true
109141
name: example-before-each-visit
@@ -322,6 +354,7 @@ workflows:
322354
- unit
323355
- frontend coverage
324356
- backend coverage
357+
- fullstack coverage
325358
- example-before-each-visit
326359
- example-before-all-visit
327360
- example-ts-example

examples/fullstack/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"start": "../../node_modules/.bin/nyc --silent node server/server",
77
"cy:open": "../../node_modules/.bin/cypress open",
8-
"dev": "../../node_modules/.bin/start-test 3003 cy:open"
8+
"dev": "../../node_modules/.bin/start-test 3003 cy:open",
9+
"report": "../../node_modules/.bin/nyc report --reporter text"
910
}
1011
}

0 commit comments

Comments
 (0)