Documentation: Update Next.js portable stories instructions for Vitest

This commit is contained in:
Valentin Palkovic 2024-08-05 09:48:11 +02:00
parent b94ead30bd
commit 9398495cca
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
```tsx filename="Button.test.tsx" renderer="react" language="ts"
import { test, expect } from 'vitest';
import { screen } from '@testing-library/react';
// 👉 Using Next.js? Import from @storybook/nextjs instead
import { composeStories } from '@storybook/react';
// Import all stories and the component annotations from the stories file

View File

@ -28,7 +28,7 @@ sidebar:
<If renderer="react">
<Callout variant="warning">
**Using `Next.js`?** Next.js requires specific configuration that is only available in [Jest](./portable-stories-jest.mdx). The portable stories API is not supported in Next.js with Vitest.
**Using `Next.js`?** Next.js support for Vitest is now possible by using the [vite-plugin-storybook-nextjs](https://github.com/storybookjs/vite-plugin-storybook-nextjs) Plugin. Please make sure that the plugin is installed and set up.
</Callout>
</If>