Skip to content

Commit

Permalink
fixed the test timeout implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeemnagarji committed Dec 5, 2024
1 parent cca1300 commit 1ece1b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"test:vitest": "vitest run",
"test:vitest:watch": "vitest",
"test:vitest:coverage": "vitest run --coverage",
"test": "cross-env NODE_ENV=test jest --env=./scripts/custom-test-env.js --watchAll --coverage",
"eject": "react-scripts eject",
"lint:check": "eslint \"**/*.{ts,tsx}\" --max-warnings=0 && python .github/workflows/eslint_disable_check.py",
"lint:fix": "eslint --fix \"**/*.{ts,tsx}\"",
Expand Down
9 changes: 5 additions & 4 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import { vi } from 'vitest';
import { vi, beforeAll } from 'vitest';

global.fetch = vi.fn();

import { format } from 'util';
Expand Down Expand Up @@ -31,6 +32,6 @@ import 'flag-icons/css/flag-icons.min.css';
// });

// Use the global setTimeout function
setTimeout(() => {
console.log('SetTimeout is working correctly');
}, 15000);
beforeAll(() => {
vi.setConfig({ testTimeout: 15000 });
});

0 comments on commit 1ece1b7

Please sign in to comment.