Skip to content

Commit 44ea89a

Browse files
committed
improve detection and update docs
1 parent 777b931 commit 44ea89a

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Storybook test runner turns all of your stories into executable tests.
44

55
> [!WARNING]
6-
> If you're using Storybook in a Vite-based project, you might want to use [Storybook's Vitest integration](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon?ref=test-runner-migration) instead. It's faster, provides features out of the box such as a11y and coverage, and integrates well with all Storybook's latest features.
6+
> If you're using Storybook in a Vite-based project, you might want to use [Storybook's Vitest integration](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon?ref=test-runner-migration) instead. It's faster, provides features out of the box such as a11y and coverage, and integrates well with all Storybook's latest features. [Read the migration steps here](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon/migration-guide).
77
88
<h2>Table of Contents</h2>
99

src/test-storybook.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,13 @@ const main = async () => {
424424
const { storiesPaths, lazyCompilation, disableTelemetry, enableCrashReports, frameworkName } =
425425
await getStorybookMetadata();
426426

427-
if (frameworkName.includes('vite')) {
427+
const shouldMigrateToVitest =
428+
frameworkName.includes('vite') || frameworkName.includes('sveltekit');
429+
430+
if (shouldMigrateToVitest) {
428431
warnOnce(
429-
'Detected Vite-based Storybook project, you might benefit from migrating to the Vitest addon, a modern, faster and more feature-rich testing solution for Storybook: https://storybook.js.org/docs/writing-tests/integrations/vitest-addon?ref=test-runner-migration'
430-
);
432+
'Detected Vite-based Storybook project, you might benefit from migrating to the Vitest addon, a modern, faster and more feature-rich testing solution for Storybook:\nhttps://storybook.js.org/docs/writing-tests/integrations/vitest-addon/migration-guide?ref=test-runner-migration'
433+
)();
431434
}
432435

433436
if (!shouldRunIndexJson) {

0 commit comments

Comments
 (0)