Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ public/invoice_data.json
/.claude/*

# release notes temp file
release-notes.json
release-notes.json

#coverage
coverage
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"generate-release-notes": "node scripts/generate-release-notes.js",
"update-release-notes": "node scripts/update-release-notes-story.js",
"release-notes": "npm run generate-release-notes && npm run update-release-notes",
"test": "vitest",
"test:ui": "vitest --ui",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
"prepare": "husky"
},
"keywords": [
Expand Down Expand Up @@ -83,8 +87,8 @@
"react-chartjs-2": "^5.3.0"
},
"devDependencies": {
"@cegid/vsb-cds-illustrations": "1.0.3",
"@cegid/cds-react": "^3.26.1",
"@cegid/vsb-cds-illustrations": "1.0.3",
"@chromatic-com/storybook": "^4.0.1",
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
Expand All @@ -95,13 +99,20 @@
"@storybook/addon-docs": "^9.0.16",
"@storybook/addon-links": "^9.0.16",
"@storybook/react-vite": "^9.0.16",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^22.15.19",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "3.2.4",
"@vitest/ui": "^4.0.16",
"date-fns": "^2.30.0",
"glob": "^11.0.0",
"husky": "^9.1.7",
"jsdom": "^27.3.0",
"path": "^0.12.7",
"prop-types": "^15.8.1",
"react": "^18.3.1",
Expand Down
36 changes: 36 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';

export default defineConfig({
plugins: [
react({
jsxRuntime: 'automatic',
jsxImportSource: 'react',
}),
],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
css: true,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'dist/',
'**/*.stories.tsx',
'**/*.d.ts',
'**/index.ts',
'scripts/',
'storybook-static/',
],
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
});
11 changes: 11 additions & 0 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { expect, afterEach } from 'vitest';
import { cleanup } from '@testing-library/react';
import * as matchers from '@testing-library/jest-dom/matchers';

// Extend Vitest's expect with jest-dom matchers
expect.extend(matchers);

// Cleanup after each test
afterEach(() => {
cleanup();
});
Loading