Socket
Socket
Sign inDemoInstall

storybook_vitest_addon

Package Overview
Dependencies
135
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    storybook_vitest_addon

Adds a panel to display Vitest unit test results


Version published
Weekly downloads
1.6K
decreased by-9.11%
Maintainers
1
Install size
715 kB
Created
Weekly downloads
 

Readme

Source

storybook_vitest_addon

Release

Installation:

yarn add storybook_vitest_addon

Compatibility:

"storybook": "^7.6.7",
"@storybook/react": "^7.6.7",
"vite": "^5.0.10",
"vitest": "^1.1.0"

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

Keywords

FAQs

Last updated on 02 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc