From 075ff57237f856c781a9d438e1c0d13915f12ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Mon, 13 Jul 2026 14:12:02 +0200 Subject: [PATCH] fix: nightly RN 0.88 --- .github/actions/setup-deps-react-18/action.yml | 4 ++-- .github/actions/setup-deps-rn-latest/action.yml | 7 +++++-- .github/actions/setup-deps-rn-next/action.yml | 7 +++++-- .github/actions/setup-deps-rn-nightly/action.yml | 7 +++++-- .github/actions/setup-deps/action.yml | 4 ++-- .github/actions/setup-website-deps/action.yml | 4 ++-- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/example-apps.yml | 4 ++-- .github/workflows/react-native-latest.yml | 6 +++--- .github/workflows/react-native-next.yml | 6 +++--- .github/workflows/react-native-nightly.yml | 6 +++--- .github/workflows/website.yml | 4 ++-- src/helpers/map-props.ts | 2 +- src/matchers/__tests__/to-be-disabled.test.tsx | 9 ++++++--- src/user-event/press/__tests__/longPress.test.tsx | 11 +++++------ src/user-event/press/__tests__/press.test.tsx | 11 +++++------ tsconfig.json | 5 +++-- 17 files changed, 60 insertions(+), 49 deletions(-) diff --git a/.github/actions/setup-deps-react-18/action.yml b/.github/actions/setup-deps-react-18/action.yml index a6e028f8..c2159a6e 100644 --- a/.github/actions/setup-deps-react-18/action.yml +++ b/.github/actions/setup-deps-react-18/action.yml @@ -5,13 +5,13 @@ runs: using: composite steps: - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: .nvmrc - name: Cache deps id: yarn-cache - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ./node_modules diff --git a/.github/actions/setup-deps-rn-latest/action.yml b/.github/actions/setup-deps-rn-latest/action.yml index a811040c..fb9fc845 100644 --- a/.github/actions/setup-deps-rn-latest/action.yml +++ b/.github/actions/setup-deps-rn-latest/action.yml @@ -5,13 +5,13 @@ runs: using: composite steps: - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: .nvmrc - name: Cache deps id: yarn-cache - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ./node_modules @@ -31,4 +31,7 @@ runs: yarn add -D react-native@latest \ @react-native/babel-preset@latest \ @react-native/jest-preset@latest + # RN 0.85+ ships the Jest preset as a standalone package, so point the + # config at it instead of the `react-native`-bundled preset (RN 0.84). + sed -i "s|preset: 'react-native'|preset: '@react-native/jest-preset'|" jest.config.js shell: bash diff --git a/.github/actions/setup-deps-rn-next/action.yml b/.github/actions/setup-deps-rn-next/action.yml index 09bf6516..5002886e 100644 --- a/.github/actions/setup-deps-rn-next/action.yml +++ b/.github/actions/setup-deps-rn-next/action.yml @@ -5,13 +5,13 @@ runs: using: composite steps: - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: .nvmrc - name: Cache deps id: yarn-cache - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ./node_modules @@ -31,4 +31,7 @@ runs: yarn add -D react-native@next \ @react-native/babel-preset@next \ @react-native/jest-preset@next + # RN 0.85+ ships the Jest preset as a standalone package, so point the + # config at it instead of the `react-native`-bundled preset (RN 0.84). + sed -i "s|preset: 'react-native'|preset: '@react-native/jest-preset'|" jest.config.js shell: bash diff --git a/.github/actions/setup-deps-rn-nightly/action.yml b/.github/actions/setup-deps-rn-nightly/action.yml index 097c5122..46b57f0f 100644 --- a/.github/actions/setup-deps-rn-nightly/action.yml +++ b/.github/actions/setup-deps-rn-nightly/action.yml @@ -5,13 +5,13 @@ runs: using: composite steps: - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: .nvmrc - name: Cache deps id: yarn-cache - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ./node_modules @@ -32,4 +32,7 @@ runs: react-native@nightly \ @react-native/babel-preset@nightly \ @react-native/jest-preset@nightly + # RN 0.85+ ships the Jest preset as a standalone package, so point the + # config at it instead of the `react-native`-bundled preset (RN 0.84). + sed -i "s|preset: 'react-native'|preset: '@react-native/jest-preset'|" jest.config.js shell: bash diff --git a/.github/actions/setup-deps/action.yml b/.github/actions/setup-deps/action.yml index c12ff4d4..0d7a8da5 100644 --- a/.github/actions/setup-deps/action.yml +++ b/.github/actions/setup-deps/action.yml @@ -5,13 +5,13 @@ runs: using: composite steps: - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: .nvmrc - name: Cache deps id: yarn-cache - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ./node_modules diff --git a/.github/actions/setup-website-deps/action.yml b/.github/actions/setup-website-deps/action.yml index e89cb87c..0b428f4c 100644 --- a/.github/actions/setup-website-deps/action.yml +++ b/.github/actions/setup-website-deps/action.yml @@ -5,13 +5,13 @@ runs: using: composite steps: - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: .nvmrc - name: Cache website deps id: yarn-cache-website - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ./website/node_modules diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bcc6515..01411af0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: name: Lint steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps @@ -35,7 +35,7 @@ jobs: name: Typecheck steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps @@ -48,7 +48,7 @@ jobs: name: Typecheck React 18 steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-react-18 @@ -61,7 +61,7 @@ jobs: name: Test steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps @@ -70,7 +70,7 @@ jobs: run: yarn test:ci:coverage - name: Upload coverage to Codecov - uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 + uses: codecov/codecov-action@e53489f4d376d79066609109e7a95a29eb3740b1 # v7.0.0 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -79,7 +79,7 @@ jobs: name: Test React 18 steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-react-18 diff --git a/.github/workflows/example-apps.yml b/.github/workflows/example-apps.yml index 460a1e3e..00bc6a87 100644 --- a/.github/workflows/example-apps.yml +++ b/.github/workflows/example-apps.yml @@ -23,10 +23,10 @@ jobs: timeout-minutes: 10 steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: 24 cache: 'yarn' diff --git a/.github/workflows/react-native-latest.yml b/.github/workflows/react-native-latest.yml index 7881cd00..6959554c 100644 --- a/.github/workflows/react-native-latest.yml +++ b/.github/workflows/react-native-latest.yml @@ -20,7 +20,7 @@ jobs: name: Lint steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-latest @@ -33,7 +33,7 @@ jobs: name: Typecheck steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-latest @@ -46,7 +46,7 @@ jobs: name: Test steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-latest diff --git a/.github/workflows/react-native-next.yml b/.github/workflows/react-native-next.yml index f8f98b32..f73205d5 100644 --- a/.github/workflows/react-native-next.yml +++ b/.github/workflows/react-native-next.yml @@ -20,7 +20,7 @@ jobs: name: Lint steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-next @@ -33,7 +33,7 @@ jobs: name: Typecheck steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-next @@ -46,7 +46,7 @@ jobs: name: Test steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-next diff --git a/.github/workflows/react-native-nightly.yml b/.github/workflows/react-native-nightly.yml index f8cd82f5..ab18e25f 100644 --- a/.github/workflows/react-native-nightly.yml +++ b/.github/workflows/react-native-nightly.yml @@ -20,7 +20,7 @@ jobs: name: Lint steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-nightly @@ -33,7 +33,7 @@ jobs: name: Typecheck steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-nightly @@ -46,7 +46,7 @@ jobs: name: Test steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and deps uses: ./.github/actions/setup-deps-rn-nightly diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index f302fc8e..244193ae 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -18,7 +18,7 @@ jobs: name: Test Website steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and website deps uses: ./.github/actions/setup-website-deps @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js and website deps uses: ./.github/actions/setup-website-deps diff --git a/src/helpers/map-props.ts b/src/helpers/map-props.ts index 1c268928..829e6eea 100644 --- a/src/helpers/map-props.ts +++ b/src/helpers/map-props.ts @@ -70,7 +70,7 @@ export function defaultMapProps(props: Record): Record { render( - // @ts-expect-error - JSX element type 'Component' does not have any construct or call signatures. + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore - JSX element type 'Component' does not have any construct or call signatures. Button , @@ -191,7 +192,8 @@ test.each([ 'toBeDisabled()/toBeEnabled() supports %s with "aria-disabled" prop', (_, Component) => { render( - // @ts-expect-error - JSX element type 'Component' does not have any construct or call signatures. + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore - JSX element type 'Component' does not have any construct or call signatures. Hello , @@ -218,7 +220,8 @@ test.each([ 'toBeDisabled()/toBeEnabled() supports %s with "accessibilityState.disabled" prop', (_, Component) => { render( - // @ts-expect-error - JSX element type 'Component' does not have any construct or call signatures. + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore - JSX element type 'Component' does not have any construct or call signatures. Hello , diff --git a/src/user-event/press/__tests__/longPress.test.tsx b/src/user-event/press/__tests__/longPress.test.tsx index 9901465c..d033e87c 100644 --- a/src/user-event/press/__tests__/longPress.test.tsx +++ b/src/user-event/press/__tests__/longPress.test.tsx @@ -193,11 +193,10 @@ describe('userEvent.longPress with fake timers', () => { const user = userEvent.setup(); const compositeView = screen.getByTestId('view').parent as ReactTestInstance; - await expect(user.longPress(compositeView)).rejects.toThrowErrorMatchingInlineSnapshot(` - "longPress() works only with host elements. Passed element has type "function Component() { - (0, _classCallCheck2.default)(this, Component); - return _callSuper(this, Component, arguments); - }"." - `); + // The stringified component type varies across React Native versions, so we + // only assert the stable prefix of the error message. + await expect(user.longPress(compositeView)).rejects.toThrow( + /^longPress\(\) works only with host elements\. Passed element has type/, + ); }); }); diff --git a/src/user-event/press/__tests__/press.test.tsx b/src/user-event/press/__tests__/press.test.tsx index 64e613d6..549c1ffa 100644 --- a/src/user-event/press/__tests__/press.test.tsx +++ b/src/user-event/press/__tests__/press.test.tsx @@ -353,12 +353,11 @@ describe('userEvent.press with fake timers', () => { const user = userEvent.setup(); const compositeView = screen.getByTestId('view').parent as ReactTestInstance; - await expect(user.press(compositeView)).rejects.toThrowErrorMatchingInlineSnapshot(` - "press() works only with host elements. Passed element has type "function Component() { - (0, _classCallCheck2.default)(this, Component); - return _callSuper(this, Component, arguments); - }"." - `); + // The stringified component type varies across React Native versions, so we + // only assert the stable prefix of the error message. + await expect(user.press(compositeView)).rejects.toThrow( + /^press\(\) works only with host elements\. Passed element has type/, + ); }); test('disables act environmennt', async () => { diff --git a/tsconfig.json b/tsconfig.json index 65a1c90c..7dde18c1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,8 +7,9 @@ "jsx": "react", "target": "ES2022", "lib": ["ES2022", "DOM"], - "module": "commonjs", - "moduleResolution": "node", + "module": "preserve", + "moduleResolution": "bundler", + "types": ["jest", "node"], "declaration": true, "noEmit": true, "outDir": "build"