Skip to content

Commit 71a3312

Browse files
[v14] chore: validate RN: latest, next, and nightly on CI (#1847)
1 parent 19a325d commit 71a3312

File tree

6 files changed

+184
-124
lines changed

6 files changed

+184
-124
lines changed

.github/actions/setup-deps-rn-nightly/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,5 @@ runs:
3131
yarn add -D \
3232
react-native@nightly \
3333
@react-native/babel-preset@nightly \
34-
35-
36-
@types/react@^19.2.7 \
34+
3735
shell: bash

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,45 @@ jobs:
139139
- name: Typecheck
140140
run: yarn typecheck
141141

142+
typecheck-rn-latest:
143+
runs-on: ubuntu-latest
144+
name: Typecheck RN Latest
145+
steps:
146+
- name: Checkout
147+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
148+
149+
- name: Setup Node.js and deps
150+
uses: ./.github/actions/setup-deps-rn-latest
151+
152+
- name: Typecheck
153+
run: yarn typecheck
154+
155+
typecheck-rn-next:
156+
runs-on: ubuntu-latest
157+
name: Typecheck RN Next
158+
steps:
159+
- name: Checkout
160+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
161+
162+
- name: Setup Node.js and deps
163+
uses: ./.github/actions/setup-deps-rn-next
164+
165+
- name: Typecheck
166+
run: yarn typecheck
167+
168+
typecheck-rn-nightly:
169+
runs-on: ubuntu-latest
170+
name: Typecheck RN Nightly
171+
steps:
172+
- name: Checkout
173+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174+
175+
- name: Setup Node.js and deps
176+
uses: ./.github/actions/setup-deps-rn-nightly
177+
178+
- name: Typecheck
179+
run: yarn typecheck
180+
142181
test:
143182
runs-on: ubuntu-latest
144183
name: Test
@@ -252,3 +291,42 @@ jobs:
252291

253292
- name: Test
254293
run: yarn test:ci
294+
295+
test-rn-latest:
296+
runs-on: ubuntu-latest
297+
name: Test RN Latest
298+
steps:
299+
- name: Checkout
300+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
301+
302+
- name: Setup Node.js and deps
303+
uses: ./.github/actions/setup-deps-rn-latest
304+
305+
- name: Test
306+
run: yarn test:ci
307+
308+
test-rn-next:
309+
runs-on: ubuntu-latest
310+
name: Test RN Next
311+
steps:
312+
- name: Checkout
313+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
314+
315+
- name: Setup Node.js and deps
316+
uses: ./.github/actions/setup-deps-rn-next
317+
318+
- name: Test
319+
run: yarn test:ci
320+
321+
test-rn-nightly:
322+
runs-on: ubuntu-latest
323+
name: Test RN Nightly
324+
steps:
325+
- name: Checkout
326+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
327+
328+
- name: Setup Node.js and deps
329+
uses: ./.github/actions/setup-deps-rn-nightly
330+
331+
- name: Test
332+
run: yarn test:ci

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"peerDependencies": {
5858
"jest": ">=29.0.0",
5959
"react": ">=19.0.0",
60-
"react-native": ">=0.71",
60+
"react-native": ">=0.78",
6161
"universal-test-renderer": "~0.10.1"
6262
},
6363
"peerDependenciesMeta": {
@@ -73,7 +73,7 @@
7373
"@babel/preset-react": "^7.28.5",
7474
"@babel/preset-typescript": "^7.28.5",
7575
"@callstack/eslint-config": "^15.0.0",
76-
"@react-native/babel-preset": "0.82.1",
76+
"@react-native/babel-preset": "0.83.1",
7777
"@release-it/conventional-changelog": "^10.0.2",
7878
"@relmify/jest-serializer-strip-ansi": "^1.0.2",
7979
"@types/jest": "^30.0.0",
@@ -86,8 +86,8 @@
8686
"eslint-plugin-simple-import-sort": "^12.1.1",
8787
"jest": "^30.2.0",
8888
"prettier": "^3.6.2",
89-
"react": "19.1.1",
90-
"react-native": "0.82.1",
89+
"react": "19.2.0",
90+
"react-native": "0.83.1",
9191
"react-native-gesture-handler": "^2.29.1",
9292
"release-it": "^19.0.6",
9393
"typescript": "^5.9.3",
@@ -99,6 +99,6 @@
9999
},
100100
"packageManager": "[email protected]",
101101
"engines": {
102-
"node": ">=18"
102+
"node": ">=20"
103103
}
104104
}

src/__tests__/fire-event.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ describe('React.Suspense integration', () => {
642642
});
643643
});
644644

645-
test('should handle unmounted elements gracefully in async mode', async () => {
645+
test('should handle unmounted elements gracefully', async () => {
646646
const onPress = jest.fn();
647647
await render(
648648
<TouchableOpacity onPress={onPress}>
@@ -651,7 +651,7 @@ test('should handle unmounted elements gracefully in async mode', async () => {
651651
);
652652

653653
const element = screen.getByText('Test');
654-
await screen.unmount();
654+
await screen.rerender(<View />);
655655

656656
// Firing async event on unmounted element should not crash
657657
await fireEvent.press(element);

src/__tests__/unsafe-fire-event-sync.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,14 +566,14 @@ describe('native events', () => {
566566

567567
test('should handle unmounted elements gracefully', () => {
568568
const onPress = jest.fn();
569-
const { unmount } = unsafe_renderSync(
569+
const { rerender } = unsafe_renderSync(
570570
<TouchableOpacity onPress={onPress}>
571571
<Text>Test</Text>
572572
</TouchableOpacity>,
573573
);
574574

575575
const element = screen.getByText('Test');
576-
unmount();
576+
rerender(<View />);
577577

578578
// Firing event on unmounted element should not crash
579579
unsafe_fireEventSync.press(element);

0 commit comments

Comments
 (0)