Skip to content

Commit

Permalink
bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
Yen Truong committed Aug 3, 2022
1 parent ce0303f commit e884ffc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -38,10 +38,10 @@
"generate-docs": "api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",
"generate-notices": "generate-license-file --input package.json --output ./THIRD-PARTY-NOTICES --overwrite",
"prepublishOnly": "npm run build",
"test": "jest --coverage",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"test-storybook": "start-storybook -p 6006 --ci & sleep 10 && test-storybook --coverage"
"test:unit": "jest --coverage --coverageDirectory=coverage/unit",
"test:visual": "./tests/scripts/visual-coverage.sh"
},
"devDependencies": {
"@babel/core": "^7.17.5",
Expand Down
11 changes: 11 additions & 0 deletions tests/scripts/visual-coverage.sh
@@ -0,0 +1,11 @@
#generate coverage from storybook test runner
start-storybook -p 6006 --ci &
echo $! #get the background job ID
sleep 10
test-storybook --coverage

#todo: kill the start-storybook command

#generate lcov coverage
cp coverage/storybook/coverage-storybook.json coverage/coverage-storybook.json
nyc report --reporter=lcov -t coverage --report-dir coverage/visual

0 comments on commit e884ffc

Please sign in to comment.