Skip to content

Commit

Permalink
Merge pull request #28779 from storybookjs/portable-stories-play-to-r…
Browse files Browse the repository at this point in the history
…un-2

Docs: Add version callout to portable stories docs
  • Loading branch information
kylegach authored Aug 1, 2024
2 parents 735b97f + 56d6496 commit 2ebbeed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/api/portable-stories/portable-stories-jest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ sidebar:

Normally, Storybook composes a story and its [annotations](#annotations) automatically, as part of the [story pipeline](#story-pipeline). When using stories in Jest tests, you must handle the story pipeline yourself, which is what the [`composeStories`](#composestories) and [`composeStory`](#composestory) functions enable.

<Callout variant="info">
The API specified here is available in Storybook `8.2.7` and up. If you're using an older version of Storybook, you can upgrade to the latest version (`npx storybook@latest upgrade`) to use this API. If you're unable to upgrade, you can use previous API, which uses the `.play()` method instead of `.run()`, but is otherwise identical.
</Callout>

<If renderer="react">
<Callout variant="info">
**Using `Next.js`?** You need to do three things differently when using portable stories in Jest with Next.js projects:
Expand Down
4 changes: 4 additions & 0 deletions docs/api/portable-stories/portable-stories-vitest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ sidebar:

Normally, Storybook composes a story and its [annotations](#annotations) automatically, as part of the [story pipeline](#story-pipeline). When using stories in Vitest tests, you must handle the story pipeline yourself, which is what the [`composeStories`](#composestories) and [`composeStory`](#composestory) functions enable.

<Callout variant="info">
The API specified here is available in Storybook `8.2.7` and up. If you're using an older version of Storybook, you can upgrade to the latest version (`npx storybook@latest upgrade`) to use this API. If you're unable to upgrade, you can use previous API, which uses the `.play()` method instead of `.run()`, but is otherwise identical.
</Callout>

<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.
Expand Down

0 comments on commit 2ebbeed

Please sign in to comment.