Skip to content

Commit c88b660

Browse files
Merge pull request storybookjs#33456 from storybookjs/docs_fix_a11y_manual_config
Docs: Fix A11y manual setup example
2 parents 9511a9c + dc24243 commit c88b660

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

docs/writing-tests/accessibility-testing.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,17 @@ This allows you to run accessibility tests automatically with your component tes
5050

5151
If you need to configure this manually (for example, if the automigration was skipped), you can add the following to your `.storybook/vitest.setup.ts`:
5252

53-
```ts
54-
import * as previewAnnotations from '@storybook/preview-api';
55-
// Replace your-renderer with the renderer you are using, e.g. react, svelte, vue3, etc.
56-
import { setProjectAnnotations } from '@storybook/your-renderer';
53+
```ts title=".storybook/vitest.setup.js|ts"
54+
// Replace your-framework with the framework you are using, e.g., react-vite, nextjs-vite, etc.
55+
import { setProjectAnnotations } from '@storybook/your-framework';
5756
import * as a11yAddonAnnotations from '@storybook/addon-a11y/preview';
5857

58+
import * as previewAnnotations from './preview';
59+
5960
const annotations = setProjectAnnotations([
60-
a11yAddonAnnotations,
61-
previewAnnotations,
61+
a11yAddonAnnotations,
62+
previewAnnotations
6263
]);
63-
64-
// Run Storybook's beforeAll hook
65-
beforeAll(annotations.beforeAll);
6664
```
6765

6866
<If renderer="react">

0 commit comments

Comments
 (0)