Skip to content

Commit f432de3

Browse files
authored
Add tests for React Native 0.78 (#480)
1 parent 6160f00 commit f432de3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+12304
-1400
lines changed

.circleci/config.yml

Lines changed: 26 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
version: 2.1
22

33
aliases:
4-
- &xcode-version 15.4.0
5-
- &node-version '20.10.0'
6-
- &yarn-version '1.22.19'
4+
- &node-version '22.14.0'
5+
- &yarn-version '1.22.22'
76

87
orbs:
9-
node: circleci/node@5.1.1
10-
browser-tools: circleci/browser-tools@1.4.6
8+
node: circleci/node@5.3.0
9+
browser-tools: circleci/browser-tools@1.5.3
1110
android: circleci/[email protected]
1211

1312
executors:
1413
node:
1514
docker:
16-
- image: cimg/node:20.10.0
15+
- image: cimg/node:22.14.0
1716
working_directory: ~/react-native-url-polyfill
1817
environment:
1918
NODE_OPTIONS: '--openssl-legacy-provider'
2019
node-browsers:
2120
docker:
22-
- image: cimg/node:20.10.0-browsers
21+
- image: cimg/node:22.14.0-browsers
2322
environment:
2423
NODE_OPTIONS: '--openssl-legacy-provider'
25-
xcode:
26-
macos:
27-
xcode: *xcode-version
28-
environment:
29-
HOMEBREW_NO_AUTO_UPDATE: 1
30-
XCODE_VERSION: *xcode-version
31-
NODE_OPTIONS: '--openssl-legacy-provider'
3224
android:
3325
docker:
34-
- image: cimg/android:2023.06.1
26+
- image: cimg/android:2023.12.1-node
3527
resource_class: large
3628
environment:
3729
JAVA_TOOL_OPTIONS: '-Xmx1536m'
@@ -194,15 +186,19 @@ jobs:
194186
command: yarn test
195187
test-ios:
196188
parameters:
197-
executor:
198-
default: xcode
199-
type: executor
200189
react-native-version:
201190
type: string
191+
xcode-version:
192+
type: string
202193
install-yarn:
203194
type: boolean
204195
default: true
205-
executor: << parameters.executor >>
196+
macos:
197+
xcode: << parameters.xcode-version >>
198+
environment:
199+
HOMEBREW_NO_AUTO_UPDATE: 1
200+
XCODE_VERSION: << parameters.xcode-version >>
201+
NODE_OPTIONS: '--openssl-legacy-provider'
206202
working_directory: ~/react-native-url-polyfill/platforms/react-native/<< parameters.react-native-version >>
207203
steps:
208204
- attach-workspace
@@ -266,31 +262,6 @@ jobs:
266262
name: Build APK
267263
command: cd android && ./gradlew assembleRelease
268264
- save-android-build-cache
269-
test-hermes-ios:
270-
parameters:
271-
executor:
272-
default: xcode
273-
type: executor
274-
react-native-version:
275-
type: string
276-
executor: << parameters.executor >>
277-
working_directory: ~/react-native-url-polyfill/platforms/react-native/<< parameters.react-native-version >>
278-
steps:
279-
- attach-workspace
280-
- restore-cache-detox-app
281-
- run:
282-
name: Enable Hermes
283-
command: npx shx sed -i "s/:hermes_enabled\s=>\sfalse/:hermes_enabled => true/g" ios/Podfile
284-
- install-node
285-
- install-yarn-dependencies
286-
- install-detox
287-
- run:
288-
name: Install Pods
289-
command: |
290-
cd ios && pod install
291-
- run:
292-
name: Run Detox on iOS
293-
command: yarn e2e:ios
294265
test-expo-web:
295266
parameters:
296267
expo-version:
@@ -330,25 +301,26 @@ workflows:
330301
requires:
331302
- checkout
332303
- test-ios:
333-
matrix:
334-
parameters:
335-
react-native-version: ['0.72']
304+
name: test-ios-0.72
305+
react-native-version: '0.72'
306+
xcode-version: 15.4.0
307+
requires:
308+
- lint
309+
- test-js
310+
- test-ios:
311+
name: test-ios-0.78
312+
react-native-version: '0.78'
313+
xcode-version: 16.2.0
336314
requires:
337315
- lint
338316
- test-js
339317
- test-android:
340318
matrix:
341319
parameters:
342-
react-native-version: ['0.68', '0.72']
320+
react-native-version: ['0.68', '0.72', '0.78']
343321
requires:
344322
- lint
345323
- test-js
346-
# - test-hermes-ios:
347-
# matrix:
348-
# parameters:
349-
# react-native-version: ['0.68']
350-
# requires:
351-
# - test-ios-<< matrix.react-native-version >>
352324
- test-hermes-android:
353325
matrix:
354326
parameters:

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
},
3535
"devDependencies": {
3636
"@react-native-community/eslint-config": "3.2.0",
37-
"detox": "20.14.3",
37+
"@types/node": "^22.13.10",
38+
"detox": "20.34.5",
3839
"eslint": "8.56.0",
3940
"eslint-plugin-prettier": "5.1.1",
4041
"husky": "8.0.3",
@@ -43,10 +44,10 @@
4344
"metro-react-native-babel-preset": "0.76.7",
4445
"nanoid": "3.3.7",
4546
"prettier": "3.1.1",
46-
"react": "18.2.0",
47-
"react-native": "0.72.1",
47+
"react": "19.0.0",
48+
"react-native": "0.78.0",
4849
"react-native-bundle-scale": "1.1.0",
49-
"typescript": "5.3.3"
50+
"typescript": "5.8.2"
5051
},
5152
"peerDependencies": {
5253
"react-native": "*"

platforms/detox/.detoxrc.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ module.exports = {
3737
},
3838
},
3939
devices: {
40-
simulator: {
40+
simulator15: {
4141
type: 'ios.simulator',
4242
device: {
4343
type: 'iPhone 15 Pro',
4444
},
4545
},
46+
simulator: {
47+
type: 'ios.simulator',
48+
device: {
49+
type: 'iPhone 16 Pro',
50+
},
51+
},
4652
attached: {
4753
type: 'android.attached',
4854
device: {
@@ -61,6 +67,10 @@ module.exports = {
6167
device: 'simulator',
6268
app: 'ios.debug',
6369
},
70+
'ios.sim.release.15': {
71+
device: 'simulator15',
72+
app: 'ios.release',
73+
},
6474
'ios.sim.release': {
6575
device: 'simulator',
6676
app: 'ios.release',

platforms/react-native/0.68/metro.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ module.exports = {
1414
resolver: {
1515
blockList: [
1616
new RegExp(`${reactNativeLib}/node_modules/react-native/.*`),
17+
new RegExp(`${reactNativeLib}/node_modules/react/.*`),
1718
new RegExp(`${reactNativeLib}/platforms/react-native/((?!0.68).).*`),
1819
new RegExp(`${reactNativeLib}/platforms/expo/.*`),
1920
new RegExp(path.resolve(__dirname, 'ios/.*')),
2021
],
2122
extraNodeModules: {
2223
'react-native': path.resolve(__dirname, 'node_modules/react-native'),
24+
'react': path.resolve(__dirname, 'node_modules/react'),
25+
'react-native-url-polyfill': path.resolve(__dirname, reactNativeLib),
2326
},
2427
},
2528
transformer: {

platforms/react-native/0.72/metro.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ const config = {
1515
resolver: {
1616
blockList: [
1717
new RegExp(`${reactNativeLib}/node_modules/react-native/.*`),
18+
new RegExp(`${reactNativeLib}/node_modules/react/.*`),
1819
new RegExp(`${reactNativeLib}/platforms/react-native/((?!0.72).).*`),
1920
new RegExp(`${reactNativeLib}/platforms/expo/.*`),
2021
new RegExp(path.resolve(__dirname, 'ios/.*')),
2122
],
2223
extraNodeModules: {
2324
'react-native': path.resolve(__dirname, 'node_modules/react-native'),
25+
'react': path.resolve(__dirname, 'node_modules/react'),
26+
'react-native-url-polyfill': reactNativeLib,
2427
},
2528
},
2629
};

platforms/react-native/0.72/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"lint": "eslint .",
99
"start": "react-native start",
1010
"test": "jest",
11-
"build:ios": "detox build --configuration ios.sim.release",
12-
"test:ios": "detox test --configuration ios.sim.release --cleanup",
11+
"build:ios": "detox build --configuration ios.sim.release.15",
12+
"test:ios": "detox test --configuration ios.sim.release.15 --cleanup --headless",
1313
"e2e:ios": "yarn build:ios && yarn test:ios",
1414
"build:android": "detox build --configuration android.emu.release",
1515
"test:android": "detox test --configuration android.emu.release",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "@tsconfig/react-native/tsconfig.json"
2+
"extends": "@react-native/typescript-config/tsconfig.json"
33
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const detoxConfig = require('../../detox/.detoxrc.js');
2+
3+
/** @type {Detox.DetoxConfig} */
4+
module.exports = detoxConfig;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

0 commit comments

Comments
 (0)