Skip to content

Commit

Permalink
feat:升级测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
SunLxy committed Jul 11, 2023
1 parent ec58148 commit 38720ca
Show file tree
Hide file tree
Showing 52 changed files with 441 additions and 1,101 deletions.
4 changes: 2 additions & 2 deletions example/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react": "18.0.0",
"react-native": "0.69.7",
"react-native-gesture-handler": "2.8.0",
"react-native-image-picker": "^5.3.1",
"react-native-image-picker": "~5.3.1",
"react-native-image-viewing": "~0.2.2",
"react-native-root-siblings": "4.1.1",
"react-native-svg": "13.9.0"
Expand All @@ -35,4 +35,4 @@
"jest": {
"preset": "react-native"
}
}
}
4 changes: 2 additions & 2 deletions example/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"react": "18.0.0",
"react-native": "0.69.7",
"react-native-gesture-handler": "~2.5.0",
"react-native-image-picker": "^5.3.1",
"react-native-image-picker": "~5.3.1",
"react-native-image-viewing": "~0.2.2",
"react-native-safe-area-context": "~4.3.1",
"react-native-screens": "~3.15.0",
Expand Down Expand Up @@ -53,4 +53,4 @@
"node"
]
}
}
}
4 changes: 2 additions & 2 deletions packages/react-native-image-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@uiw/react-native": "4.0.11",
"ahooks": "3.7.6",
"prop-types": "15.7.2",
"react-native-image-picker": "^5.3.1",
"react-native-image-picker": "~5.3.1",
"react-native-image-viewing": "~0.2.2",
"react-native-svg": "13.9.0"
},
Expand All @@ -54,4 +54,4 @@
"engines": {
"node": ">=16.0.0"
}
}
}
File renamed without changes.
21 changes: 21 additions & 0 deletions test-ci/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
extends: '@react-native',
rules: {
'prettier/prettier': 0,
'react-native/no-inline-styles': 0,
semi: 0,
'no-console': 2,
'no-unused-vars': [
2,
{
vars: 'all',
args: 'after-used',
},
],
eqeqeq: 2,
'no-extra-boolean-cast': 0,
'react/no-did-mount-set-state': 0,
quotes: 0,
},
};
66 changes: 66 additions & 0 deletions test-ci/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage
7 changes: 7 additions & 0 deletions test-ci/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};
1 change: 1 addition & 0 deletions test-ci/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
53 changes: 30 additions & 23 deletions test-ci/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
* Sample React Native App
* https://github.com/facebook/react-native
*
* Generated with the TypeScript template
* https://github.com/react-native-community/react-native-template-typescript
*
* @format
*/

import React, { type PropsWithChildren } from 'react';
import { SafeAreaView, ScrollView, StatusBar, StyleSheet, Text, useColorScheme, View } from 'react-native';
import React from 'react';
import type {PropsWithChildren} from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';

import {
Colors,
Expand All @@ -19,11 +25,11 @@ import {
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

const Section: React.FC<
PropsWithChildren<{
title: string;
}>
> = ({ children, title }) => {
type SectionProps = PropsWithChildren<{
title: string;
}>;

function Section({children, title}: SectionProps): JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
return (
<View style={styles.sectionContainer}>
Expand All @@ -33,8 +39,7 @@ const Section: React.FC<
{
color: isDarkMode ? Colors.white : Colors.black,
},
]}
>
]}>
{title}
</Text>
<Text
Expand All @@ -43,15 +48,14 @@ const Section: React.FC<
{
color: isDarkMode ? Colors.light : Colors.dark,
},
]}
>
]}>
{children}
</Text>
</View>
);
};
}

const App = () => {
function App(): JSX.Element {
const isDarkMode = useColorScheme() === 'dark';

const backgroundStyle = {
Expand All @@ -64,30 +68,33 @@ const App = () => {
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
<ScrollView contentInsetAdjustmentBehavior="automatic" style={backgroundStyle}>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}>
<Header />
<View
style={{
backgroundColor: isDarkMode ? Colors.black : Colors.white,
}}
>
}}>
<Section title="Step One">
Edit <Text style={styles.highlight}>App.tsx</Text> to change this screen and then come back to see your
edits.
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
screen and then come back to see your edits.
</Section>
<Section title="See Your Changes">
<ReloadInstructions />
</Section>
<Section title="Debug">
<DebugInstructions />
</Section>
<Section title="Learn More">Read the docs to discover what to do next:</Section>
<Section title="Learn More">
Read the docs to discover what to do next:
</Section>
<LearnMoreLinks />
</View>
</ScrollView>
</SafeAreaView>
);
};
}

const styles = StyleSheet.create({
sectionContainer: {
Expand Down
4 changes: 2 additions & 2 deletions test-ci/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

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

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
gem 'cocoapods', '~> 1.12'
79 changes: 79 additions & 0 deletions test-ci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).

# Getting Started

>**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.
## Step 1: Start the Metro Server

First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.

To start Metro, run the following command from the _root_ of your React Native project:

```bash
# using npm
npm start

# OR using Yarn
yarn start
```

## Step 2: Start your Application

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:

### For Android

```bash
# using npm
npm run android

# OR using Yarn
yarn android
```

### For iOS

```bash
# using npm
npm run ios

# OR using Yarn
yarn ios
```

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.

This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.

## Step 3: Modifying your App

Now that you have successfully run the app, let's modify it.

1. Open `App.tsx` in your text editor of choice and edit some lines.
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!

For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!

## Congratulations! :tada:

You've successfully run and modified your React Native App. :partying_face:

### Now what?

- 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).
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).

# Troubleshooting

If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.

# Learn More

To learn more about React Native, take a look at the following resources:

- [React Native Website](https://reactnative.dev) - learn more about React Native.
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
1 change: 0 additions & 1 deletion test-ci/_node-version

This file was deleted.

1 change: 0 additions & 1 deletion test-ci/_ruby-version

This file was deleted.

Loading

0 comments on commit 38720ca

Please sign in to comment.