diff --git a/jest/setup/refresh-control.ts b/jest/setup/refresh-control.ts index 44fabcfd..aae9b89d 100644 --- a/jest/setup/refresh-control.ts +++ b/jest/setup/refresh-control.ts @@ -1,3 +1,3 @@ import { View } from 'react-native' -module.exports = View +export default View diff --git a/jest/setup/setup.ts b/jest/setup/setup.ts index 1b0dea01..1226ef58 100644 --- a/jest/setup/setup.ts +++ b/jest/setup/setup.ts @@ -31,9 +31,11 @@ jest.mock('react-native-haptic-feedback', () => { } }) +import refreshControl from './refresh-control' + jest.mock('react-native/Libraries/Components/RefreshControl/RefreshControl', () => ({ __esModule: true, - default: require('./refresh-control'), + default: refreshControl, })) jest.mock('react-native-toast-message', () => { diff --git a/package.json b/package.json index 624d2478..81c68119 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "@react-native/typescript-config": "0.81.0", "@types/jest": "^30.0.0", "@types/lodash": "^4.17.20", + "@types/node": "^24.2.1", "@types/react": "^19.1.9", "@types/react-native-vector-icons": "^6.4.18", "@types/react-test-renderer": "19.1.0", diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index e58e97d4..204c6b31 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -43,7 +43,7 @@ export default function Search({ }) const search = useCallback(() => { - let timeout: NodeJS.Timeout + let timeout: ReturnType return () => { clearTimeout(timeout) diff --git a/src/utils/sleep.ts b/src/utils/sleep.ts index d79702c4..2a24248d 100644 --- a/src/utils/sleep.ts +++ b/src/utils/sleep.ts @@ -7,4 +7,5 @@ * @param ms The number of milliseconds to sleep * @returns A promise that resolves after the given number of milliseconds */ -export const sleepify = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)) +export const sleepify = (ms: number) => + new Promise((resolve) => setTimeout(() => resolve(undefined), ms)) diff --git a/tsconfig.json b/tsconfig.json index 50b35efe..5c65b5d8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,8 @@ "paths": { "@/*": ["./*"] }, - "jsx": "react-native" + "jsx": "react-native", + "types": ["jest"], + "skipLibCheck": true } } diff --git a/yarn.lock b/yarn.lock index 576346da..848950ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3524,6 +3524,13 @@ dependencies: undici-types "~7.8.0" +"@types/node@^24.2.1": + version "24.2.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.2.1.tgz#83e41543f0a518e006594bb394e2cd961de56727" + integrity sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ== + dependencies: + undici-types "~7.10.0" + "@types/react-native-vector-icons@^6.4.18": version "6.4.18" resolved "https://registry.yarnpkg.com/@types/react-native-vector-icons/-/react-native-vector-icons-6.4.18.tgz#18671c617b9d0958747bc959903470dde91a8c79" @@ -9631,6 +9638,11 @@ underscore@*: resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.7.tgz#970e33963af9a7dda228f17ebe8399e5fbe63a10" integrity sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g== +undici-types@~7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" + integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== + undici-types@~7.8.0: version "7.8.0" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.8.0.tgz#de00b85b710c54122e44fbfd911f8d70174cd294"