diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08b7f987..2044f963 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/packages/addons/_tests/storybook/test.ts b/packages/addons/_tests/storybook/test.ts index 8e796638..2f9ac4c1 100644 --- a/packages/addons/_tests/storybook/test.ts +++ b/packages/addons/_tests/storybook/test.ts @@ -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'; @@ -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 },