storybook-vitest

Installation
SKILL.md

Storybook Vitest + Svelte CSF

Stories are .stories.svelte with defineMeta and <Story> from @storybook/addon-svelte-csf. Official reference: Vitest addon, use it for plugin, browser mode, CLI, tags, debugging, CI; ignore non-Svelte story file examples there. Manual setup · Example configuration files · Options

How it works

  • Plugin storybookTest turns stories into Vitest tests via portable stories (Vitest). No Storybook server required for the test run.
  • Each <Story>: smoke render; a play function runs as the interaction test (interaction testing, asserting with expect).
  • Console errors fail the test. MSW in .storybook/preview applies when configured (v2+ if you use MSW).
  • Test coverage: see Storybook’s coverage doc; vitest --coverage --project … only covers projects you pass (many pipelines omit storybook on purpose).
  • With the addon, snapshot tests are not supported (unlike the test runner; comparison).

.stories.svelte + play

Use storybook/test (expect, within, userEvent, waitFor) in play. Scope queries with canvasElement to within(canvasElement).

Installs
1
GitHub Stars
10
First Seen
9 days ago
storybook-vitest — fubits1/svelte-skills