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: 2 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ jobs:
uses: ./.github/actions/install-and-build-sdk
- name: Lint
run: yarn lerna-workspaces run lint
- name: Typecheck tests
run: cd package && yarn test:typecheck
- name: Test
run: yarn test:coverage
13 changes: 10 additions & 3 deletions package/jest-setup.js → package/jest-setup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* global require */
import rn, { FlatList, View } from 'react-native';
import type { ReactNode } from 'react';
import { FlatList, View } from 'react-native';

import mockRNCNetInfo from '@react-native-community/netinfo/jest/netinfo-mock.js';
import mockSafeAreaContext from 'react-native-safe-area-context/jest/mock';
Expand Down Expand Up @@ -36,12 +37,18 @@ registerNativeHandlers({

jest.mock('react-native-reanimated', () => {
const RNReanimatedmock = require('react-native-reanimated/mock');
return { ...RNReanimatedmock, runOnUI: (fn) => fn };
return { ...RNReanimatedmock, runOnUI: (fn: () => unknown) => fn };
});

jest.mock('@react-native-community/netinfo', () => mockRNCNetInfo);

const BottomSheetMock = ({ handleComponent, children }) => (
const BottomSheetMock = ({
handleComponent,
children,
}: {
handleComponent: () => ReactNode;
children: ReactNode;
}) => (
<View>
{handleComponent()}
{children}
Expand Down
2 changes: 1 addition & 1 deletion package/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
setupFiles: ['./node_modules/react-native-gesture-handler/jestSetup.js'],
setupFilesAfterEnv: [
'@testing-library/jest-native/extend-expect',
require.resolve('./jest-setup.js'),
require.resolve('./jest-setup.tsx'),
],
testEnvironment: 'node',
testPathIgnorePatterns: ['/node_modules/', '/examples/', '__snapshots__', '/lib/'],
Expand Down
6 changes: 4 additions & 2 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"prettier": "prettier --list-different '**/*.{js,ts,tsx,md,json}' eslint.config.mjs ../.prettierrc babel.config.js",
"prettier-fix": "prettier --write '**/*.{js,ts,tsx,md,json}' eslint.config.mjs ../.prettierrc babel.config.js",
"test:coverage": "yarn test:unit --coverage",
"test:typecheck": "tsc --noEmit -p tsconfig.test.json",
"test:unit": "TZ=UTC jest",
"validate-translations": "node bin/validate-translations.js",
"get-version": "echo $npm_package_version",
Expand Down Expand Up @@ -127,9 +128,10 @@
"@shopify/flash-list": "^2.1.0",
"@testing-library/jest-native": "^5.4.3",
"@testing-library/react-native": "13.2.0",
"@total-typescript/shoehorn": "^0.1.2",
"@types/better-sqlite3": "^7.6.13",
"@types/eslint": "9.6.1",
"@types/jest": "^29.5.14",
"@types/jest": "^30.0.0",
"@types/linkify-it": "5.0.0",
"@types/lodash": "4.17.16",
"@types/mime-types": "2.1.4",
Expand All @@ -154,7 +156,7 @@
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-native": "^5.0.0",
"i18next-cli": "^1.31.0",
"jest": "^30.0.0",
"jest": "^30.3.0",
"moment-timezone": "^0.6.0",
"prettier": "^3.5.3",
"react": "19.1.0",
Expand Down
Loading
Loading