Skip to content

Commit 38720ca

Browse files
committed
feat:升级测试用例
1 parent ec58148 commit 38720ca

Some content is hidden

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

52 files changed

+441
-1101
lines changed

example/base/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"react": "18.0.0",
1717
"react-native": "0.69.7",
1818
"react-native-gesture-handler": "2.8.0",
19-
"react-native-image-picker": "^5.3.1",
19+
"react-native-image-picker": "~5.3.1",
2020
"react-native-image-viewing": "~0.2.2",
2121
"react-native-root-siblings": "4.1.1",
2222
"react-native-svg": "13.9.0"
@@ -35,4 +35,4 @@
3535
"jest": {
3636
"preset": "react-native"
3737
}
38-
}
38+
}

example/examples/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react": "18.0.0",
2020
"react-native": "0.69.7",
2121
"react-native-gesture-handler": "~2.5.0",
22-
"react-native-image-picker": "^5.3.1",
22+
"react-native-image-picker": "~5.3.1",
2323
"react-native-image-viewing": "~0.2.2",
2424
"react-native-safe-area-context": "~4.3.1",
2525
"react-native-screens": "~3.15.0",
@@ -53,4 +53,4 @@
5353
"node"
5454
]
5555
}
56-
}
56+
}

packages/react-native-image-picker/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@uiw/react-native": "4.0.11",
3838
"ahooks": "3.7.6",
3939
"prop-types": "15.7.2",
40-
"react-native-image-picker": "^5.3.1",
40+
"react-native-image-picker": "~5.3.1",
4141
"react-native-image-viewing": "~0.2.2",
4242
"react-native-svg": "13.9.0"
4343
},
@@ -54,4 +54,4 @@
5454
"engines": {
5555
"node": ">=16.0.0"
5656
}
57-
}
57+
}
File renamed without changes.

test-ci/.eslintrc.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
rules: {
5+
'prettier/prettier': 0,
6+
'react-native/no-inline-styles': 0,
7+
semi: 0,
8+
'no-console': 2,
9+
'no-unused-vars': [
10+
2,
11+
{
12+
vars: 'all',
13+
args: 'after-used',
14+
},
15+
],
16+
eqeqeq: 2,
17+
'no-extra-boolean-cast': 0,
18+
'react/no-did-mount-set-state': 0,
19+
quotes: 0,
20+
},
21+
};

test-ci/.gitignore

+66
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

test-ci/.prettierrc.js

+7
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+
};

test-ci/.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

test-ci/App.tsx

+30-23
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22
* Sample React Native App
33
* https://github.com/facebook/react-native
44
*
5-
* Generated with the TypeScript template
6-
* https://github.com/react-native-community/react-native-template-typescript
7-
*
85
* @format
96
*/
107

11-
import React, { type PropsWithChildren } from 'react';
12-
import { SafeAreaView, ScrollView, StatusBar, StyleSheet, Text, useColorScheme, View } from 'react-native';
8+
import React from 'react';
9+
import type {PropsWithChildren} from 'react';
10+
import {
11+
SafeAreaView,
12+
ScrollView,
13+
StatusBar,
14+
StyleSheet,
15+
Text,
16+
useColorScheme,
17+
View,
18+
} from 'react-native';
1319

1420
import {
1521
Colors,
@@ -19,11 +25,11 @@ import {
1925
ReloadInstructions,
2026
} from 'react-native/Libraries/NewAppScreen';
2127

22-
const Section: React.FC<
23-
PropsWithChildren<{
24-
title: string;
25-
}>
26-
> = ({ children, title }) => {
28+
type SectionProps = PropsWithChildren<{
29+
title: string;
30+
}>;
31+
32+
function Section({children, title}: SectionProps): JSX.Element {
2733
const isDarkMode = useColorScheme() === 'dark';
2834
return (
2935
<View style={styles.sectionContainer}>
@@ -33,8 +39,7 @@ const Section: React.FC<
3339
{
3440
color: isDarkMode ? Colors.white : Colors.black,
3541
},
36-
]}
37-
>
42+
]}>
3843
{title}
3944
</Text>
4045
<Text
@@ -43,15 +48,14 @@ const Section: React.FC<
4348
{
4449
color: isDarkMode ? Colors.light : Colors.dark,
4550
},
46-
]}
47-
>
51+
]}>
4852
{children}
4953
</Text>
5054
</View>
5155
);
52-
};
56+
}
5357

54-
const App = () => {
58+
function App(): JSX.Element {
5559
const isDarkMode = useColorScheme() === 'dark';
5660

5761
const backgroundStyle = {
@@ -64,30 +68,33 @@ const App = () => {
6468
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
6569
backgroundColor={backgroundStyle.backgroundColor}
6670
/>
67-
<ScrollView contentInsetAdjustmentBehavior="automatic" style={backgroundStyle}>
71+
<ScrollView
72+
contentInsetAdjustmentBehavior="automatic"
73+
style={backgroundStyle}>
6874
<Header />
6975
<View
7076
style={{
7177
backgroundColor: isDarkMode ? Colors.black : Colors.white,
72-
}}
73-
>
78+
}}>
7479
<Section title="Step One">
75-
Edit <Text style={styles.highlight}>App.tsx</Text> to change this screen and then come back to see your
76-
edits.
80+
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
81+
screen and then come back to see your edits.
7782
</Section>
7883
<Section title="See Your Changes">
7984
<ReloadInstructions />
8085
</Section>
8186
<Section title="Debug">
8287
<DebugInstructions />
8388
</Section>
84-
<Section title="Learn More">Read the docs to discover what to do next:</Section>
89+
<Section title="Learn More">
90+
Read the docs to discover what to do next:
91+
</Section>
8592
<LearnMoreLinks />
8693
</View>
8794
</ScrollView>
8895
</SafeAreaView>
8996
);
90-
};
97+
}
9198

9299
const styles = StyleSheet.create({
93100
sectionContainer: {

test-ci/Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby '2.7.5'
4+
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
6+
gem 'cocoapods', '~> 1.12'

test-ci/README.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
2+
3+
# Getting Started
4+
5+
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
6+
7+
## Step 1: Start the Metro Server
8+
9+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
10+
11+
To start Metro, run the following command from the _root_ of your React Native project:
12+
13+
```bash
14+
# using npm
15+
npm start
16+
17+
# OR using Yarn
18+
yarn start
19+
```
20+
21+
## Step 2: Start your Application
22+
23+
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
24+
25+
### For Android
26+
27+
```bash
28+
# using npm
29+
npm run android
30+
31+
# OR using Yarn
32+
yarn android
33+
```
34+
35+
### For iOS
36+
37+
```bash
38+
# using npm
39+
npm run ios
40+
41+
# OR using Yarn
42+
yarn ios
43+
```
44+
45+
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
46+
47+
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
48+
49+
## Step 3: Modifying your App
50+
51+
Now that you have successfully run the app, let's modify it.
52+
53+
1. Open `App.tsx` in your text editor of choice and edit some lines.
54+
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
55+
56+
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
57+
58+
## Congratulations! :tada:
59+
60+
You've successfully run and modified your React Native App. :partying_face:
61+
62+
### Now what?
63+
64+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
65+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
66+
67+
# Troubleshooting
68+
69+
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
70+
71+
# Learn More
72+
73+
To learn more about React Native, take a look at the following resources:
74+
75+
- [React Native Website](https://reactnative.dev) - learn more about React Native.
76+
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
77+
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
78+
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
79+
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.

test-ci/_node-version

-1
This file was deleted.

test-ci/_ruby-version

-1
This file was deleted.

0 commit comments

Comments
 (0)