Skip to content

chore: improved storybook prefetching #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,4 @@ jobs:
- run: pnpm install --frozen-lockfile
- run: pnpm exec playwright install chromium
- run: pnpm build
# prefetch the storybook cli to reduce fetching errors in tests
- run: pnpx create-storybook@latest --version
- run: pnpm test
9 changes: 9 additions & 0 deletions packages/addons/_tests/storybook/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import process from 'node:process';
import { execSync } from 'node:child_process';
import { expect } from '@playwright/test';
import { beforeAll } from 'vitest';
import { setupTest } from '../_setup/suite.ts';
import storybook from '../../storybook/index.ts';
import eslint from '../../eslint/index.ts';
Expand All @@ -9,6 +11,13 @@ const { test, variants, prepareServer } = setupTest({ storybook, eslint });

let port = 6006;

beforeAll(() => {
if (process.env.CI) {
// prefetch the storybook cli during ci to reduce fetching errors in tests
execSync('pnpx create-storybook@latest --version');
}
});

test.for(variants)(
'storybook loaded - %s',
{ concurrent: !process.env.CI },
Expand Down
Loading