-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { beforeAll } from 'vitest'; | ||
import { setProjectAnnotations } from '@storybook/react'; | ||
import * as projectAnnotations from './preview'; | ||
|
||
// This is an important step to apply the right configuration when testing your stories. | ||
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations | ||
const project = setProjectAnnotations([projectAnnotations]); | ||
|
||
beforeAll(project.beforeAll); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { defineWorkspace } from 'vitest/config'; | ||
import { storybookTest } from '@storybook/experimental-addon-test/vite-plugin'; | ||
|
||
|
||
// More info at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest | ||
export default defineWorkspace([ | ||
'vite.config.ts', | ||
{ | ||
extends: 'vite.config.ts', | ||
plugins: [ | ||
// See options at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#storybooktest | ||
storybookTest({ | ||
storybookScript: 'yarn storybook --ci' | ||
}), | ||
], | ||
test: { | ||
name: 'storybook', | ||
browser: { | ||
enabled: true, | ||
headless: true, | ||
name: 'chromium', | ||
provider: 'playwright', | ||
}, | ||
// Make sure to adjust this pattern to match your stories files. | ||
include: ['**/*.stories.?(m)[jt]s?(x)'], | ||
setupFiles: ['./.storybook/vitest.setup.ts'], | ||
}, | ||
}, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters