Storybook Addon Vite Mock
JSON →A Storybook addon that provides Jest-like module mocking for Vite-based Storybook projects (v10+). Version 1.1.1 is current, with active development on GitHub. It replaces module imports with mock implementations during Storybook stories, using a Vite plugin and a createMock function. Unlike traditional Jest mocks that require a test runner, this addon works directly in Storybook's preview environment, allowing visual testing of components with mocked dependencies. It supports @storybook/react-vite and @storybook/nextjs-vite frameworks. The mockRestore() is automatic after story unmount. Configuration via addon options allows include/exclude patterns for builds. Ships TypeScript types.
Traffic · last 30 days ↓67% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · EG