Skip to content

Commit

Permalink
Merge pull request #29081 from storybookjs/8-3-docs-fixes
Browse files Browse the repository at this point in the history
Docs: Fixes for 8.3
  • Loading branch information
kasperpeulen authored Sep 11, 2024
2 parents 603841c + 4280ec7 commit 66b439e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions code/addons/test/src/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ export default async function postInstall(options: PostinstallOptions) {
reasons.push(
dedent`
Please check the documentation for more information about its requirements and installation:
${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest`}
${c.cyan`https://storybook.js.org/docs/writing-tests/vitest-plugin`}
`
);
} else {
reasons.push(
dedent`
Fear not, however, you can follow the manual installation process instead at:
${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual`}
${c.cyan`https://storybook.js.org/docs/writing-tests/vitest-plugin#manual`}
`
);
}
Expand Down Expand Up @@ -197,7 +197,7 @@ export default async function postInstall(options: PostinstallOptions) {
${colors.gray(vitestSetupFile)}
Please refer to the documentation to complete the setup manually:
${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual`}
${c.cyan`https://storybook.js.org/docs/writing-tests/vitest-plugin#manual`}
`
);
logger.line(1);
Expand Down Expand Up @@ -240,7 +240,7 @@ export default async function postInstall(options: PostinstallOptions) {
your existing workspace file automatically, you must do it yourself. This was the last step.
Please refer to the documentation to complete the setup manually:
${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual`}
${c.cyan`https://storybook.js.org/docs/writing-tests/vitest-plugin#manual`}
`
);
logger.line(1);
Expand All @@ -262,7 +262,7 @@ export default async function postInstall(options: PostinstallOptions) {
your existing workspace file automatically, you must do it yourself. This was the last step.
Please refer to the documentation to complete the setup manually:
${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual`}
${c.cyan`https://storybook.js.org/docs/writing-tests/vitest-plugin#manual`}
`
);
logger.line(1);
Expand All @@ -288,13 +288,13 @@ export default async function postInstall(options: PostinstallOptions) {
import { defineWorkspace } from 'vitest/config';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport}
// More info at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest
// More info at: https://storybook.js.org/docs/writing-tests/vitest-plugin
export default defineWorkspace([
'${relative(dirname(browserWorkspaceFile), rootConfig)}',
{
extends: '${viteConfigFile ? relative(dirname(browserWorkspaceFile), viteConfigFile) : ''}',
plugins: [
// See options at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#storybooktest
// See options at: https://storybook.js.org/docs/writing-tests/vitest-plugin#storybooktest
storybookTest(),${vitestInfo.frameworkPluginDocs + vitestInfo.frameworkPluginCall}
],
test: {
Expand Down Expand Up @@ -327,10 +327,10 @@ export default async function postInstall(options: PostinstallOptions) {
import { defineConfig } from 'vitest/config';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport}
// More info at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest
// More info at: https://storybook.js.org/docs/writing-tests/vitest-plugin
export default defineConfig({
plugins: [
// See options at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#storybooktest
// See options at: https://storybook.js.org/docs/writing-tests/vitest-plugin#storybooktest
storybookTest(),${vitestInfo.frameworkPluginDocs + vitestInfo.frameworkPluginCall}
],
test: {
Expand Down Expand Up @@ -362,7 +362,7 @@ export default async function postInstall(options: PostinstallOptions) {
• When using the Vitest extension in your editor, all of your stories will be shown as tests!
Check the documentation for more information about its features and options at:
${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest`}
${c.cyan`https://storybook.js.org/docs/writing-tests/vitest-plugin`}
`
);
logger.line(1);
Expand Down
2 changes: 1 addition & 1 deletion docs/_snippets/vitest-plugin-vitest-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default mergeConfig(
import { defineConfig, mergeConfig } from 'vitest/config';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';
// 👇 If you're using Sveltekit, apply this framework plugin as well
// import { storybookNextjsPlugin } from '@storybook/sveltekit/vite-plugin';
// import { storybookSveltekitPlugin } from '@storybook/sveltekit/vite-plugin';

import viteConfig from './vite.config';

Expand Down
2 changes: 1 addition & 1 deletion docs/writing-tests/component-testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You start by writing a [**story**](../writing-stories/index.mdx) to set up the c
* The test is written using Storybook-instrumented versions of [Vitest](https://vitest.dev/) and [Testing Library](https://testing-library.com/) coming from the [`@storybook/test`](https://npmjs.com/package/@storybook/test) package.
* [`@storybook/addon-interactions`](https://storybook.js.org/addons/@storybook/addon-interactions/) visualizes the test in Storybook and provides a playback interface for convenient browser-based debugging.
* [`@storybook/test-runner`](https://github.com/storybookjs/test-runner) is a standalone utility—powered by [Jest](https://jestjs.io/) and [Playwright](https://playwright.dev/)—that executes all of your interactions tests and catches broken stories.
* The experimental [test runner with Vitest](./test-runner-with-vitest.mdx) is also available, which transforms your stories into Vitest tests and runs them in a browser.
* The experimental [Vitest plugin](./vitest-plugin.mdx) is also available, which transforms your stories into Vitest tests and runs them in a browser.

## Set up the interactions addon

Expand Down

0 comments on commit 66b439e

Please sign in to comment.