Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Nov 6, 2024
1 parent 8281bf1 commit dacd3f9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ const config: StorybookConfig = {
'../src/**/*.stories.@(js|jsx|ts|tsx)',
],
addons: [
'@storybook/experimental-addon-test',
'@chromatic-com/storybook',
'@storybook/addon-essentials',
'@storybook/addon-a11y',
'@storybook/addon-coverage',
'@storybook/addon-designs',
'@storybook/experimental-addon-test'
],
typescript: {
reactDocgen: 'react-docgen',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/browser": "^2.1.2",
"@vitest/coverage-v8": "^2.1.2",
"@vitest/browser": "2.1.2",
"@vitest/coverage-v8": "2.1.2",
"babel-loader": "8.1.0",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-open-source": "^1.3.3",
Expand Down Expand Up @@ -119,7 +119,7 @@
"vite": "^4.0.0",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.1.2",
"vitest": "2.1.2",
"vitest-axe": "^0.1.0",
"vitest-canvas-mock": "^0.3.3",
"wait-on": "^7.2.0"
Expand Down
21 changes: 17 additions & 4 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@
import { mergeConfig, coverageConfigDefaults } from 'vitest/config'
import viteConfig from './vite.config'

export default mergeConfig(viteConfig,{
export default mergeConfig(viteConfig, {
test: {
environment: 'happy-dom',
include: ['**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
exclude: [...coverageConfigDefaults.exclude, 'storybook.setup.ts', 'src/**/*.stories.*', '.storybook'],
exclude: [
...coverageConfigDefaults.exclude,
'storybook.setup.ts',
'**/*.stories.*',
'.storybook',
'src/docs',
'src/components/Button/utils.tsx',
'public',
'functions',
'**/conditional-logic.ts',
'**/RestaurantCard/progress',
'**/RestaurantsSection.container.tsx',
'src/stub',
'ps-setup.ts',
'**/serviceWorker.ts',
],
},
},
})
3 changes: 2 additions & 1 deletion vitest.workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineWorkspace([
// See options at: https://storybook.js.org/docs/writing-tests/vitest-plugin#storybooktest
storybookTest({ configDir: '.storybook' }),
],
publicDir: 'public',
test: {
name: 'storybook',
browser: {
Expand All @@ -24,4 +25,4 @@ export default defineWorkspace([
setupFiles: ['.storybook/vitest.setup.ts'],
},
},
]);
]);
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3558,7 +3558,7 @@ __metadata:
languageName: node
linkType: hard

"@vitest/browser@npm:^2.1.2":
"@vitest/browser@npm:2.1.2":
version: 2.1.2
resolution: "@vitest/browser@npm:2.1.2"
dependencies:
Expand Down Expand Up @@ -3586,7 +3586,7 @@ __metadata:
languageName: node
linkType: hard

"@vitest/coverage-v8@npm:^2.1.2":
"@vitest/coverage-v8@npm:2.1.2":
version: 2.1.2
resolution: "@vitest/coverage-v8@npm:2.1.2"
dependencies:
Expand Down Expand Up @@ -5093,8 +5093,8 @@ __metadata:
"@typescript-eslint/eslint-plugin": "npm:^7.8.0"
"@typescript-eslint/parser": "npm:^7.8.0"
"@vitejs/plugin-react": "npm:^4.2.1"
"@vitest/browser": "npm:^2.1.2"
"@vitest/coverage-v8": "npm:^2.1.2"
"@vitest/browser": "npm:2.1.2"
"@vitest/coverage-v8": "npm:2.1.2"
axios: "npm:^1.6.8"
babel-loader: "npm:8.1.0"
babel-plugin-istanbul: "npm:^6.1.1"
Expand Down Expand Up @@ -5138,7 +5138,7 @@ __metadata:
vite: "npm:^4.0.0"
vite-plugin-svgr: "npm:^4.2.0"
vite-tsconfig-paths: "npm:^4.3.2"
vitest: "npm:^2.1.2"
vitest: "npm:2.1.2"
vitest-axe: "npm:^0.1.0"
vitest-canvas-mock: "npm:^0.3.3"
wait-on: "npm:^7.2.0"
Expand Down Expand Up @@ -13972,7 +13972,7 @@ __metadata:
languageName: node
linkType: hard

"vitest@npm:^2.1.2":
"vitest@npm:2.1.2":
version: 2.1.2
resolution: "vitest@npm:2.1.2"
dependencies:
Expand Down

0 comments on commit dacd3f9

Please sign in to comment.