Skip to content

Commit

Permalink
Merge pull request #26342 from storybookjs/cli-copy-edit
Browse files Browse the repository at this point in the history
CLI: Automigrations copy edits
  • Loading branch information
jonniebigodes authored Mar 25, 2024
2 parents 772ce6e + 3aaa3bd commit 83de652
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions code/lib/cli/src/automigrate/fixes/remove-argtypes-regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,20 @@ export const removeArgtypesRegex: Fix<{ argTypesRegex: NodePath; previewConfigPa
${argTypesRegex.buildCodeFrameError(`${previewConfigPath}`).message}
In Storybook you can write so-called play functions, which are used to render your stories interactively.
Mocking action args in play functions was done implicitly by analyzing the argTypesRegex.
Since Storybook 8, implicit action args mocking isn't supported anymore.
Storybook's play functions let you render your stories interactively.
In the past, play functions mocked action args implicitly by analyzing the argTypesRegex
in your preview.js|ts file.
However, Storybook 8 changes this behavior, and we now recommend using the
(fn) function to mock your component's methods instead.
Use the following command to check for mocked action usages in your play functions:
Use the following command to check for implied mocked actions in your play functions:
${chalk.cyan(
'npx storybook migrate find-implicit-spies --glob="**/*.stories.@(js|jsx|ts|tsx)"'
)}
And follow the documentation to migrate your play functions:
Then, refer to our docs to migrate your play functions to Storybook 8:
${chalk.yellow(
'https://storybook.js.org/docs/8.0/essentials/actions#via-storybooktest-fn-spy-function'
)}
Expand Down

0 comments on commit 83de652

Please sign in to comment.