Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ jobs:
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Unit Tests for Changed Files Only
run: yarn run test:changed
run: NODE_OPTIONS="--max-old-space-size=4096" yarn run test:changed
- name: Run Lint
run: yarn run lint
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: yarn install

- name: Run tests
run: yarn test
run: NODE_OPTIONS="--max-old-space-size=4096" yarn test

- name: Upload test results
if: failure()
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@
"@typescript-eslint/eslint-plugin": "^8.44.1",
"@typescript-eslint/parser": "^8.44.1",
"@vitejs/plugin-react": "^4.5.0",
"@vitest/ui": "3.2.2",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"babel-jest": "^29.7.0",
"baseline-browser-mapping": "^2.9.17",
"cross-env": "^5.2.1",
Expand Down Expand Up @@ -206,7 +207,7 @@
"stylelint-config-standard": "^39.0.1",
"typescript": "^4.8.4",
"vite": "^6.3.5",
"vitest": "^3.2.0"
"vitest": "^3.2.4"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand Down
5 changes: 5 additions & 0 deletions src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ vi.mock('html2canvas', () => ({
})),
}));

// Mock AutoUpdate component to prevent intervals in tests
vi.mock('../components/AutoUpdate', () => ({
default: () => null,
}));

// Mock jspdf
vi.mock('jspdf', () => ({
jsPDF: vi.fn().mockImplementation(() => ({
Expand Down
10 changes: 10 additions & 0 deletions vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,15 @@ export default defineConfig({
environment: 'jsdom',
globals: true,
setupFiles: ['./src/setupTests.js'],
testTimeout: 30000, // 30 seconds timeout
pool: 'threads',
poolOptions: {
threads: {
singleThread: false,
useAtomics: true,
},
},
maxThreads: 4,
minThreads: 1,
},
});
Loading