New
Build your own StorybookGPTVisual test with Chromatic
Star81,146
Back to integrations
Add your integration
Categories
  • ⭐️ Popular
  • 🧩 Essentials
  • 🛠 Code
  • ⚡️ Data & state
  • ✅ Test
  • 💅 Style
  • 🎨 Design
  • ⚙️ Appearance
  • 🗄 Organize
How to install addons Create an addon
Storybook Vitest
Adds a panel to display Vitest unit test results
npm install storybook_vitest_addon
Last updated about 1 month ago
3.3k
Downloads per week
Readme View on GitHub

storybook_vitest_addon

Release

Installation:

yarn add storybook_vitest_addon

Compatibility:

"storybook": "^7.5.2",
"@storybook/react": "^7.5.2",
"vite": "^4.5.0",
"vitest": "^0.34.6"

Description:

Addon meant to display Vitest unit test results in a new Stoybook panel. Developed and tested with React. Simply add it to the addon list in your Storybook config, and then you can use it in any story.

The addon offers minimal visuals for maximum clarity. It needs 2 params: testResults - test results file in json format and testFile - name of the component test file (TypeScript definitions available).

Example usage:

// Button.stories.tsx

import vitestResults from "./unit-test-results.json";
/.../
export default {
  title: "Example/Button",
  component: Button,
  parameters: {
    vitest: {
      testFile: "Button.test.tsx",
      testResults: vitestResults,
    },
  },
};
/.../

Also see https://storybook.js.org/addons/storybook_vitest_addon

Join the community
6,379 developers and counting
WhyWhy StorybookComponent-driven UI
Open source software
Storybook

Maintained by
Chromatic
Special thanks to Netlify and CircleCI