storybookVis
storybookVis() is the Vitest plugin of the addon.
Add it next to storybookTest() in vitest.config.ts.
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'import { storybookVis } from 'storybook-addon-vis/vitest-plugin'import { defineConfig } from 'vitest/config'
export default defineConfig({ plugins: [storybookTest(), storybookVis()],})Signature
Section titled “Signature”function storybookVis<M extends ComparisonMethod>( options?: Omit<VisOptions<M>, 'preset'> | undefined,): anyThe return type is any so the plugin fits different Vitest and Vite versions.
Options
Section titled “Options”The options are the options of the vis plugin of vitest-plugin-vis, minus preset.
The addon sets the preset itself, to custom, because stories take their own snapshots.
It names the plugin storybook-addon-vis.
This page does not repeat the options.
Related
Section titled “Related”- Configuration for where it goes.
- Import path:
storybook-addon-vis/vitest-plugin. The same entry also exportstrimCommonFolder, seetrimCommonFolder.