Skip to content

Commit 8897878

Browse files
authored
Add test for React Native 0.72 (#452)
1 parent c5bbb39 commit 8897878

Some content is hidden

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

70 files changed

+10277
-5
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ workflows:
303303
- test-ios:
304304
matrix:
305305
parameters:
306-
react-native-version: ['0.68']
306+
react-native-version: ['0.68', '0.72']
307307
requires:
308308
- lint
309309
- test-js

platforms/detox/.detoxrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = {
5252
emulator: {
5353
type: 'android.emulator',
5454
device: {
55-
avdName: 'Pixel_3a_API_30_x86',
55+
avdName: 'Pixel_3a_API_34_extension_level_7_arm64-v8a',
5656
},
5757
},
5858
},

platforms/detox/urlPolyfill.test.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ describe('URL Polyfill', () => {
2828
});
2929

3030
it('should handle test 3', async () => {
31-
await expect(element(by.id('url-test-3'))).toHaveText(
32-
'blob:1?offset=32&size=64',
33-
);
31+
if (device.getPlatform() === 'ios') {
32+
await expect(element(by.id('url-test-3'))).toHaveText(
33+
'blob:1?offset=32&size=64',
34+
);
35+
} else if (device.getPlatform() === 'android') {
36+
await expect(element(by.id('url-test-3'))).toHaveText(
37+
'content://com.detox.blobs/1?offset=32&size=64',
38+
);
39+
}
3440
});
3541
});
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+
};
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
37+
# node.js
38+
#
39+
node_modules/
40+
npm-debug.log
41+
yarn-error.log
42+
43+
# fastlane
44+
#
45+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46+
# screenshots whenever they are needed.
47+
# For more information about the recommended setup visit:
48+
# https://docs.fastlane.tools/best-practices/source-control/
49+
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# Ruby / CocoaPods
59+
/ios/Pods/
60+
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

platforms/react-native/0.72/App.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
*
5+
* @format
6+
*/
7+
8+
import React from 'react';
9+
import {SafeAreaView, StatusBar, useColorScheme} from 'react-native';
10+
11+
import TestPolyfill from '../../detox/TestPolyfill';
12+
13+
function App(): JSX.Element {
14+
const isDarkMode = useColorScheme() === 'dark';
15+
16+
return (
17+
<SafeAreaView>
18+
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
19+
<TestPolyfill />
20+
</SafeAreaView>
21+
);
22+
}
23+
24+
export default App;

0 commit comments

Comments
 (0)