Skip to content

Commit ae90ee1

Browse files
committed
build(block-storage): migrate to shared vitest config
ref: #TAPC-5335 Signed-off-by: Thomas Esseul <[email protected]>
1 parent 4a4f9fb commit ae90ee1

File tree

2 files changed

+39
-50
lines changed

2 files changed

+39
-50
lines changed

packages/manager/apps/pci-block-storage/package.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
"type": "module",
77
"scripts": {
88
"build": "tsc --project tsconfig.build.json && vite build",
9-
"coverage": "vitest run --coverage",
9+
"coverage": "manager-test run --coverage",
1010
"lint": "eslint ./src",
1111
"start": "vite",
12-
"test": "vitest run"
12+
"test": "manager-test run",
13+
"test:watch": "manager-test --watch"
1314
},
1415
"dependencies": {
1516
"@hookform/resolvers": "^5.0.1",
@@ -48,28 +49,19 @@
4849
"zod": "^3.24.2"
4950
},
5051
"devDependencies": {
51-
"@jest/globals": "^29.7.0",
5252
"@ovh-ux/manager-tests-setup": "^0.4.7",
5353
"@ovh-ux/manager-vite-config": "^0.15.0",
5454
"@tanstack/react-query-devtools": "5.51.21",
55-
"@testing-library/dom": "^10.1.0",
56-
"@testing-library/jest-dom": "^6.4.5",
57-
"@testing-library/react": "^16.0.0",
58-
"@testing-library/user-event": "^14.5.2",
5955
"@types/file-saver": "^2.0.7",
60-
"@types/jest": "29.5.12",
6156
"@types/react": "18.3.18",
6257
"@types/react-dom": "18.3.0",
63-
"@vitejs/plugin-react": "^4.3.0",
64-
"@vitest/coverage-v8": "^2.1.9",
6558
"autoprefixer": "^10.4.19",
6659
"eslint": "^8.56.0",
6760
"postcss": "^8.4.38",
6861
"rollup": "^4.18.0",
6962
"tailwindcss": "^3.4.4",
7063
"typescript": "^5.4.5",
71-
"vite": "6.3.4",
72-
"vitest": "^2.1.9"
64+
"vite": "6.3.4"
7365
},
7466
"regions": [
7567
"CA",
Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
1-
import { defaultDedupedDependencies } from '@ovh-ux/manager-tests-setup';
21
import path from 'path';
3-
import { defineConfig } from 'vite';
4-
import react from '@vitejs/plugin-react';
2+
import {
3+
sharedConfig,
4+
mergeConfig,
5+
createConfig,
6+
defaultDedupedDependencies,
7+
defaultExcludedFiles,
8+
} from '@ovh-ux/manager-tests-setup';
59

6-
// https://vitejs.dev/config/
7-
export default defineConfig({
8-
plugins: [react()],
9-
test: {
10-
globals: true,
11-
environment: 'jsdom',
12-
setupFiles: './src/setupTests.ts',
13-
server: {
14-
deps: {
15-
inline: [/@ovhcloud\/ods-react\/.*/i],
10+
export default mergeConfig(
11+
sharedConfig,
12+
createConfig({
13+
test: {
14+
setupFiles: './src/setupTests.ts',
15+
server: {
16+
deps: {
17+
inline: [/@ovhcloud\/ods-react\/.*/i],
18+
},
19+
},
20+
coverage: {
21+
exclude: [
22+
...defaultExcludedFiles,
23+
// App-specific exclusions (not in shared config):
24+
'vite-*.ts',
25+
'App.tsx',
26+
'main.tsx',
27+
'routes.tsx',
28+
'__mocks__',
29+
'queryClient.ts',
30+
],
1631
},
1732
},
18-
coverage: {
19-
include: ['src'],
20-
exclude: [
21-
'src/interface',
22-
'src/__tests__',
23-
'src/**/*constants.ts',
24-
'src/**/*enum.ts',
25-
'src/vite-*.ts',
26-
'src/App.tsx',
27-
'src/core/ShellRoutingSync.tsx',
28-
'src/core/HidePreloader.tsx',
29-
'src/i18n.ts',
30-
'src/main.tsx',
31-
'src/routes.tsx',
32-
'src/queryClient.ts',
33-
],
34-
},
35-
},
36-
resolve: {
37-
dedupe: [...defaultDedupedDependencies],
38-
alias: {
39-
'@': path.resolve(__dirname, 'src'),
33+
resolve: {
34+
dedupe: [...defaultDedupedDependencies],
35+
alias: {
36+
'@': path.resolve(__dirname, 'src'),
37+
},
4038
},
41-
mainFields: ['module'],
42-
},
43-
});
39+
}),
40+
);

0 commit comments

Comments
 (0)