Skip to content

Commit

Permalink
Storybook Test
Browse files Browse the repository at this point in the history
  • Loading branch information
drozdzynski committed Aug 29, 2024
1 parent dd8d40d commit 860d37d
Show file tree
Hide file tree
Showing 5 changed files with 1,524 additions and 51 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,34 @@ jobs:
run: yarn install
- name: Run tests
run: yarn test -- --ci --coverage
storybook:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
package: [{ name: 'svelte', port: 6006 }, { name: 'vue', port: 6007 }]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v4
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-yarn-
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn build
- name: Run tests
run: |
cd packages/${{ matrix.package.name }}
yarn dlx concurrently -k -s first -n "STORYBOOK,TEST" -c "magenta,blue" \
"yarn storybook" \
"yarn dlx wait-on tcp:${{ matrix.package.port }} && yarn test-storybook --url http://localhost:${{ matrix.package.port }}"
lint:
runs-on: ubuntu-20.04
steps:
Expand Down
Binary file modified .yarn/install-state.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"dev": "rollup --config --bundleConfigAsCjs --watch",
"test": "node --experimental-vm-modules $(yarn bin jest)",
"storybook": "storybook dev -p 6006 --no-open",
"storybook-test": "test-storybook --url http://localhost:6006",
"build-storybook": "storybook build"
},
"dependencies": {
Expand All @@ -39,6 +40,7 @@
"@storybook/svelte": "^8.1.1",
"@storybook/svelte-vite": "^8.1.1",
"@storybook/test": "^8.1.1",
"@storybook/test-runner": "0.16.0",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@swc/core": "^1.7.11",
"@swc/jest": "^0.2.36",
Expand Down
2 changes: 2 additions & 0 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"dev": "rollup --config --bundleConfigAsCjs --watch",
"test": "jest",
"storybook": "storybook dev -p 6007 --no-open",
"storybook-test": "test-storybook --url http://localhost:6007",
"build-storybook": "storybook build"
},
"dependencies": {
Expand All @@ -38,6 +39,7 @@
"@storybook/addon-links": "^8.1.1",
"@storybook/blocks": "^8.1.1",
"@storybook/test": "^8.1.1",
"@storybook/test-runner": "0.16.0",
"@storybook/vue3": "^8.1.1",
"@storybook/vue3-vite": "^8.1.1",
"@swc/core": "^1.7.11",
Expand Down
Loading

0 comments on commit 860d37d

Please sign in to comment.