Skip to content

Commit

Permalink
Init visual regression
Browse files Browse the repository at this point in the history
  • Loading branch information
juliewongbandue committed Jul 14, 2023
1 parent f8352b8 commit 642d5e4
Show file tree
Hide file tree
Showing 5 changed files with 844 additions and 10 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
version: 7.26.3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 16

- uses: actions/cache@v3
name: Setup pnpm cache
Expand All @@ -119,3 +119,28 @@ jobs:

- run: pnpm i --frozen-lockfile
- run: pnpm jest

visual-regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.26.3
- uses: actions/setup-node@v3
with:
node-version: 16

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
.pnpm-store
pnpm
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}

- run: pnpm i --frozen-lockfile
- run: pnpm build-storybook

- name: Lost Pixel
uses: lost-pixel/[email protected]
15 changes: 15 additions & 0 deletions lostpixel.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { CustomProjectConfig } from 'lost-pixel';

// https://docs.lost-pixel.com/user-docs/api-reference/lost-pixel.config.js-or-ts
export const config: CustomProjectConfig = {
browser: 'chromium',
storybookShots: {
storybookUrl: './storybook-static',
},
threshold: 3,
imagePathBaseline: './baseline-images',
imagePathCurrent: './current-images',
imagePathDifference: './difference-images',
generateOnly: true,
failOnDifference: true,
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"framer-motion": "^6.5.1",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"lost-pixel": "^2.23.0",
"polished": "^4.2.2",
"pre-commit": "^1.2.2",
"prettier": "^2.8.8",
Expand Down
Loading

0 comments on commit 642d5e4

Please sign in to comment.