diff --git a/package.json b/package.json index 687ed7e9a1..399b906993 100644 --- a/package.json +++ b/package.json @@ -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}\"", diff --git a/src/setupTests.ts b/src/setupTests.ts index f011b44bfb..532c43ba6f 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -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'; @@ -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 }); +});