Skip to content

vs Storybook test-runner

The Storybook test-runner can take image snapshots of stories when you wire in jest-image-snapshot. Claims about the test-runner come from its documentation, checked on 2026-11-03.

The test-runner is built on Jest and Playwright. It runs each story in a browser and needs a running Storybook, local or published. Visual testing is not built in. The documentation shows a custom setup in .storybook/test-runner.ts: setup() extends expect with toMatchImageSnapshot from jest-image-snapshot, and postVisit takes page.screenshot() and matches it. You re-record failing snapshots with test-storybook -u. With --ci, new snapshots are not written automatically.

The documentation also says the test-runner is “superseded by the Vitest addon”, and recommends the Vitest addon for Vite-powered frameworks. storybook-addon-vis works with the Vitest addon.

The test-runner README says “Official support for Storybook Test Runner has ended” and points to Storybook’s Vitest integration for Vite-based projects (checked on 2026-11-03). Treat it as a path that Storybook no longer develops, and check the compatibility table in the README for your Storybook version before you adopt it.

Feature Test-runner with jest-image-snapshot storybook-addon-vis
Runs in Jest and Playwright, against a running Storybook Storybook Vitest addon
Setup You write the postVisit hook Plugin and tags
Automatic snapshots Every story, through your hook Yes, by tag or auto
Per-theme snapshots Not documented Yes
Thresholds Not documented on the page Yes
Review UI Not covered Vis panel

The test-runner documentation does not describe jest-image-snapshot options, so this page makes no claim about them. See the jest-image-snapshot project for its options.

  • It also runs play functions, accessibility checks and DOM snapshots in one tool.
  • It can test a deployed Storybook with TARGET_URL.
  • It supports sharding (--shard) and JUnit output.
  • Visual testing is the purpose of the package, so there is no hook to write.
  • It takes snapshots per theme and per viewport.
  • It shows failed snapshots in the Vis panel.
  • It follows the Vitest addon, which Storybook now recommends.

Choose it when you are on a setup the Vitest addon does not cover, and already use Jest. Check that its README lists your Storybook version first.

Choose it for any new Storybook project that uses the Vitest addon.

Remove the postVisit snapshot code from .storybook/test-runner.ts. Install the addon as the get started page shows. Baselines from jest-image-snapshot are not reused, so create new ones on the first run.