-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yen Truong
committed
Aug 3, 2022
1 parent
e884ffc
commit 045154f
Showing
4 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# run unit test and visual coverage test | ||
npm run test:unit | ||
npm run test:visual | ||
|
||
# merge | ||
mkdir -p coverage/merge | ||
cp coverage/unit/coverage-final.json coverage/merge/coverage-final.json | ||
cp coverage/visual/coverage-storybook.json coverage/merge/coverage-storybook.json | ||
nyc report --reporter=lcov --reporter=text -t coverage/merge --report-dir coverage/merge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# run jest tests and generate lcov coverage | ||
jest --coverage --coverageDirectory=coverage/unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
#generate coverage from storybook test runner | ||
#!/bin/bash | ||
|
||
#generate coverage from storybook test-runner | ||
start-storybook -p 6006 --ci & | ||
echo $! #get the background job ID | ||
JOB_ID=$(echo $!) #get the background job ID | ||
sleep 10 | ||
test-storybook --coverage | ||
|
||
#todo: kill the start-storybook command | ||
# kill the start-storybook command | ||
kill -9 $JOB_ID | ||
|
||
#generate lcov coverage for visual tests from story book | ||
rm -r coverage/visual | ||
nyc report --reporter=lcov -t coverage/storybook --report-dir coverage/visual | ||
|
||
#generate lcov coverage | ||
cp coverage/storybook/coverage-storybook.json coverage/coverage-storybook.json | ||
nyc report --reporter=lcov -t coverage --report-dir coverage/visual | ||
#clean up | ||
cp coverage/storybook/coverage-storybook.json coverage/visual/coverage-storybook.json | ||
rm -r coverage/storybook |