Skip to content

Commit

Permalink
build(npm): Add vrt commands to npm-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ruedap committed Sep 19, 2020
1 parent 0fc0b10 commit de791a1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ storybook-static/
.reg
regconfig.json
__screenshots__/
.storycap/
Binary file removed .storycap/__screenshots__/actual/sample.png
Binary file not shown.
4 changes: 2 additions & 2 deletions components/atoms/markdown/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const body = `
<h4>h4 見出し</h4>
<h5>h5 見出し</h5>
<h6>h6 見出し</h6>
<p>Mattis curabitur penatibus pulvinar consequat taciti nunc aptent libero feugiat, vitae platea accumsan tristique ligula viverra sollicitudin dolor mollis est, tempor nibh hac netus adipiscing felis odio rutrum.</p>
<p>Mattis curabitur penatibus pulvinar <a href="#">consequat</a> taciti nunc aptent libero feugiat, vitae platea accumsan tristique ligula viverra sollicitudin dolor mollis est, tempor nibh hac netus adipiscing felis odio rutrum.</p>
`

Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
"analyze": "ANALYZE=true npm run build",
"storybook": "start-storybook -s ./public -p 6006",
"build-storybook": "build-storybook -s ./public",
"vrt:cap": "storycap --serverTimeout 60000 --captureTimeout 10000 --serverCmd 'http-server storybook-static --ci -p 6007' http://localhost:6007",
"vrt:cap:build-storybook": "build-storybook --static-dir ./public --output-dir .storycap/storybook-static",
"vrt:cap": "npm run vrt:cap:build-storybook && storycap --serverTimeout 60000 --captureTimeout 10000 --serverCmd 'http-server .storycap/storybook-static --ci -p 6007' http://localhost:6007",
"vrt:cap:before": "npm run vrt:cap -- --outDir .storycap/screenshots/before",
"vrt:cap:after": "npm run vrt:cap -- --outDir .storycap/screenshots/after",
"vrt:diff": "reg-cli .storycap/screenshots/after .storycap/screenshots/before .storycap/screenshots/diff --report .storycap/report.html --json .storycap/reg.json --matchingThreshold 0.1",
"vrt:report": "open .storycap/report.html",
"vrt:check": "npm run vrt:cap:after && npm run vrt:diff || npm run vrt:report",
"vrt:run": "reg-suit run",
"vrt": "npm run build-storybook && npm run vrt:cap && npm run vrt:run",
"ci:vrt:config": "cpy ./regconfig.ci.json ./ --rename=regconfig.json",
Expand Down
1 change: 1 addition & 0 deletions reg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"failedItems":["components/atoms/header_logo/index/Default.png","components/atoms/markdown/index/Default.png"],"newItems":[],"deletedItems":[],"passedItems":["components/atoms/footer_logo/index/Default.png","components/atoms/time_svg/index/Default.png","components/atoms/time/index/Default.png"],"expectedItems":["components/atoms/footer_logo/index/Default.png","components/atoms/header_logo/index/Default.png","components/atoms/markdown/index/Default.png","components/atoms/time_svg/index/Default.png","components/atoms/time/index/Default.png"],"actualItems":["components/atoms/footer_logo/index/Default.png","components/atoms/header_logo/index/Default.png","components/atoms/markdown/index/Default.png","components/atoms/time_svg/index/Default.png","components/atoms/time/index/Default.png"],"diffItems":["components/atoms/header_logo/index/Default.png","components/atoms/markdown/index/Default.png"],"actualDir":"./.storycap/screenshots/before","expectedDir":"./.storycap/screenshots/after","diffDir":"./.storycap/screenshots/diff"}

0 comments on commit de791a1

Please sign in to comment.