Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Upgrade tests for react-native-tvos repo cleans up if patching fails, 1`] = `
"info Fetching diff between v0.62.2-1 and v0.64.2-4...
[fs] write tmp-upgrade-rn.patch
$ execa git rev-parse --show-prefix
$ execa git apply --binary --check tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
info Applying diff...
warn Excluding files that exist in the template, but not in your project:
- .flowconfig
error Excluding files that failed to apply the diff:
- ios/MyApp.xcodeproj/project.pbxproj
Please make sure to check the actual changes after the upgrade command is finished.
You can find them in our Upgrade Helper web app: https://react-native-community.github.io/upgrade-helper/?from=0.62.2-1&to=0.64.2-4
$ execa git apply tmp-upgrade-rn.patch --exclude=package.json --exclude=.flowconfig --exclude=ios/MyApp.xcodeproj/project.pbxproj -p2 --3way --directory=
debug \\"git apply\\" failed. Error output:
error: .flowconfig: does not exist in index
error: ios/MyApp.xcodeproj/project.pbxproj: patch does not apply
error Automatically applying diff failed. We did our best to automatically upgrade as many files as possible
[fs] unlink tmp-upgrade-rn.patch
$ execa git status -s
error Patch failed to apply for unknown reason. Please fall back to manual way of upgrading
warn After resolving conflicts don't forget to run \\"pod install\\" inside \\"ios\\" directory
info You may find these resources helpful:
• Release notes: https://github.com/facebook/react-native/releases/tag/v0.64.2-4
• Manual Upgrade Helper: https://react-native-community.github.io/upgrade-helper/?from=0.62.2-1&to=0.64.2-4
• Git diff: https://raw.githubusercontent.com/react-native-tvos/rn-diff-purge-tv/diffs/diffs/0.62.2-1..0.64.2-4.diff"
`;

exports[`Upgrade tests for react-native-tvos repo fetches empty patch and installs deps 1`] = `
"info Fetching diff between v0.62.2-1 and v0.64.2-4...
info Diff has no changes to apply, proceeding further
info Installing \\"react-native@0.64.2-4\\" and its peer dependencies...
$ execa npm info react-native-tvos@0.64.2-4 peerDependencies --json
$ yarn add react-native@npm:react-native-tvos@0.64.2-4 react@16.6.3
$ execa git add package.json
$ execa git add yarn.lock
$ execa git add package-lock.json
info Installing CocoaPods dependencies (this may take a few minutes)
success Upgraded React Native to v0.64.2-4 🎉. Now you can review and commit the changes"
`;

exports[`Upgrade tests for react-native-tvos repo fetches regular patch, adds remote, applies patch, installs deps, removes remote when updated from nested directory 1`] = `
"info Fetching diff between v0.62.2-1 and v0.64.2-4...
[fs] write tmp-upgrade-rn.patch
$ execa git rev-parse --show-prefix
$ execa git apply --binary --check tmp-upgrade-rn.patch --exclude=NestedApp/package.json -p2 --3way --directory=NestedApp/
info Applying diff...
$ execa git apply tmp-upgrade-rn.patch --exclude=NestedApp/package.json -p2 --3way --directory=NestedApp/
[fs] unlink tmp-upgrade-rn.patch
$ execa git status -s
info Installing \\"react-native@0.64.2-4\\" and its peer dependencies...
$ execa npm info react-native-tvos@0.64.2-4 peerDependencies --json
$ yarn add react-native@npm:react-native-tvos@0.64.2-4 react@16.6.3
$ execa git add package.json
$ execa git add yarn.lock
$ execa git add package-lock.json
info Installing CocoaPods dependencies (this may take a few minutes)
info Running \\"git status\\" to check what changed...
$ execa git status
success Upgraded React Native to v0.64.2-4 🎉. Now you can review and commit the changes"
`;

exports[`Upgrade tests for react-native-tvos repo fetches regular patch, adds remote, applies patch, installs deps, removes remote, 1`] = `
"info Fetching diff between v0.62.2-1 and v0.64.2-4...
[fs] write tmp-upgrade-rn.patch
$ execa git rev-parse --show-prefix
$ execa git apply --binary --check tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
info Applying diff...
$ execa git apply tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
[fs] unlink tmp-upgrade-rn.patch
$ execa git status -s
info Installing \\"react-native@0.64.2-4\\" and its peer dependencies...
$ execa npm info react-native-tvos@0.64.2-4 peerDependencies --json
$ yarn add react-native@npm:react-native-tvos@0.64.2-4 react@16.6.3
$ execa git add package.json
$ execa git add yarn.lock
$ execa git add package-lock.json
info Installing CocoaPods dependencies (this may take a few minutes)
info Running \\"git status\\" to check what changed...
$ execa git status
success Upgraded React Native to v0.64.2-4 🎉. Now you can review and commit the changes"
`;

exports[`Upgrade tests for react-native-tvos repo fetches regular patch, adds remote, applies patch, installs deps, removes remote,: RnDiffApp is replaced with app name (TestApp and com.testapp) 1`] = `
"Snapshot Diff:
- First value
+ Second value

@@ -1,9 +1,9 @@
- diff --git a/RnDiffApp/android/app/src/main/AndroidManifest.xml b/RnDiffApp/android/app/src/main/AndroidManifest.xml
+ diff --git a/TestApp/android/app/src/main/AndroidManifest.xml b/TestApp/android/app/src/main/AndroidManifest.xml
index bc3a9310..f3e0d155 100644
- --- a/RnDiffApp/android/app/src/main/AndroidManifest.xml
- +++ b/RnDiffApp/android/app/src/main/AndroidManifest.xml
+ --- a/TestApp/android/app/src/main/AndroidManifest.xml
+ +++ b/TestApp/android/app/src/main/AndroidManifest.xml
@@ -1,8 +1,7 @@
<manifest xmlns:android=\\"http://schemas.android.com/apk/res/android\\"
- - package=\\"com.rndiffapp\\">
- + package=\\"com.rndiffapp\\">
+ - package=\\"com.testapp\\">
+ + package=\\"com.testapp\\">

@@ -14,6 +14,6 @@
android:name=\\".MainApplication\\"
- diff --git a/RnDiffApp/ios/RnDiffApp/AppDelegate.h b/RnDiffApp/ios/RnDiffApp/AppDelegate.h
+ diff --git a/TestApp/ios/TestApp/AppDelegate.h b/TestApp/ios/TestApp/AppDelegate.h
index 4b5644f2..2726d5e1 100644
- --- a/RnDiffApp/ios/RnDiffApp/AppDelegate.h
- +++ b/RnDiffApp/ios/RnDiffApp/AppDelegate.h
+ --- a/TestApp/ios/TestApp/AppDelegate.h
+ +++ b/TestApp/ios/TestApp/AppDelegate.h
@@ -5,9 +5,10 @@
@@ -29,6 +29,6 @@
@property (nonatomic, strong) UIWindow *window;
- diff --git a/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java b/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
+ diff --git a/TestApp/android/app/src/main/java/com/testapp/MainApplication.java b/TestApp/android/app/src/main/java/com/testapp/MainApplication.java
index bc3a9310..f3e0d155 100644
- --- a/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
- +++ b/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
+ --- a/TestApp/android/app/src/main/java/com/testapp/MainApplication.java
+ +++ b/TestApp/android/app/src/main/java/com/testapp/MainApplication.java
"
`;

exports[`Upgrade tests for react-native-tvos repo works with --name-ios and --name-android: RnDiffApp is replaced with app name (CustomIos and co.uk.customandroid.app) 1`] = `
"Snapshot Diff:
- First value
+ Second value

@@ -1,9 +1,9 @@
- diff --git a/RnDiffApp/android/app/src/main/AndroidManifest.xml b/RnDiffApp/android/app/src/main/AndroidManifest.xml
+ diff --git a/CustomIos/android/app/src/main/AndroidManifest.xml b/CustomIos/android/app/src/main/AndroidManifest.xml
index bc3a9310..f3e0d155 100644
- --- a/RnDiffApp/android/app/src/main/AndroidManifest.xml
- +++ b/RnDiffApp/android/app/src/main/AndroidManifest.xml
+ --- a/CustomIos/android/app/src/main/AndroidManifest.xml
+ +++ b/CustomIos/android/app/src/main/AndroidManifest.xml
@@ -1,8 +1,7 @@
<manifest xmlns:android=\\"http://schemas.android.com/apk/res/android\\"
- - package=\\"com.rndiffapp\\">
- + package=\\"com.rndiffapp\\">
+ - package=\\"co.uk.customandroid.app\\">
+ + package=\\"co.uk.customandroid.app\\">

@@ -14,6 +14,6 @@
android:name=\\".MainApplication\\"
- diff --git a/RnDiffApp/ios/RnDiffApp/AppDelegate.h b/RnDiffApp/ios/RnDiffApp/AppDelegate.h
+ diff --git a/CustomIos/ios/CustomIos/AppDelegate.h b/CustomIos/ios/CustomIos/AppDelegate.h
index 4b5644f2..2726d5e1 100644
- --- a/RnDiffApp/ios/RnDiffApp/AppDelegate.h
- +++ b/RnDiffApp/ios/RnDiffApp/AppDelegate.h
+ --- a/CustomIos/ios/CustomIos/AppDelegate.h
+ +++ b/CustomIos/ios/CustomIos/AppDelegate.h
@@ -5,9 +5,10 @@
@@ -29,6 +29,6 @@
@property (nonatomic, strong) UIWindow *window;
- diff --git a/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java b/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
+ diff --git a/CustomIos/android/app/src/main/java/co/uk/customandroid/app/MainApplication.java b/CustomIos/android/app/src/main/java/co/uk/customandroid/app/MainApplication.java
index bc3a9310..f3e0d155 100644
- --- a/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
- +++ b/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
+ --- a/CustomIos/android/app/src/main/java/co/uk/customandroid/app/MainApplication.java
+ +++ b/CustomIos/android/app/src/main/java/co/uk/customandroid/app/MainApplication.java
"
`;
Original file line number Diff line number Diff line change
@@ -1,6 +1,88 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`fetches regular patch, adds remote, applies patch, installs deps, removes remote,: RnDiffApp is replaced with app name (TestApp and com.testapp) 1`] = `
exports[`Upgrade tests for react-native repo cleans up if patching fails, 1`] = `
"info Fetching diff between v0.57.8 and v0.58.4...
[fs] write tmp-upgrade-rn.patch
$ execa git rev-parse --show-prefix
$ execa git apply --binary --check tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
info Applying diff...
warn Excluding files that exist in the template, but not in your project:
- .flowconfig
error Excluding files that failed to apply the diff:
- ios/MyApp.xcodeproj/project.pbxproj
Please make sure to check the actual changes after the upgrade command is finished.
You can find them in our Upgrade Helper web app: https://react-native-community.github.io/upgrade-helper/?from=0.57.8&to=0.58.4
$ execa git apply tmp-upgrade-rn.patch --exclude=package.json --exclude=.flowconfig --exclude=ios/MyApp.xcodeproj/project.pbxproj -p2 --3way --directory=
debug \\"git apply\\" failed. Error output:
error: .flowconfig: does not exist in index
error: ios/MyApp.xcodeproj/project.pbxproj: patch does not apply
error Automatically applying diff failed. We did our best to automatically upgrade as many files as possible
[fs] unlink tmp-upgrade-rn.patch
$ execa git status -s
error Patch failed to apply for unknown reason. Please fall back to manual way of upgrading
warn After resolving conflicts don't forget to run \\"pod install\\" inside \\"ios\\" directory
info You may find these resources helpful:
• Release notes: https://github.com/facebook/react-native/releases/tag/v0.58.4
• Manual Upgrade Helper: https://react-native-community.github.io/upgrade-helper/?from=0.57.8&to=0.58.4
• Git diff: https://raw.githubusercontent.com/react-native-community/rn-diff-purge/diffs/diffs/0.57.8..0.58.4.diff"
`;

exports[`Upgrade tests for react-native repo fetches empty patch and installs deps 1`] = `
"info Fetching diff between v0.57.8 and v0.58.4...
info Diff has no changes to apply, proceeding further
info Installing \\"react-native@0.58.4\\" and its peer dependencies...
$ execa npm info react-native@0.58.4 peerDependencies --json
$ yarn add react-native@0.58.4 react@16.6.3
$ execa git add package.json
$ execa git add yarn.lock
$ execa git add package-lock.json
info Installing CocoaPods dependencies (this may take a few minutes)
success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
`;

exports[`Upgrade tests for react-native repo fetches regular patch, adds remote, applies patch, installs deps, removes remote when updated from nested directory 1`] = `
"info Fetching diff between v0.57.8 and v0.58.4...
[fs] write tmp-upgrade-rn.patch
$ execa git rev-parse --show-prefix
$ execa git apply --binary --check tmp-upgrade-rn.patch --exclude=NestedApp/package.json -p2 --3way --directory=NestedApp/
info Applying diff...
$ execa git apply tmp-upgrade-rn.patch --exclude=NestedApp/package.json -p2 --3way --directory=NestedApp/
[fs] unlink tmp-upgrade-rn.patch
$ execa git status -s
info Installing \\"react-native@0.58.4\\" and its peer dependencies...
$ execa npm info react-native@0.58.4 peerDependencies --json
$ yarn add react-native@0.58.4 react@16.6.3
$ execa git add package.json
$ execa git add yarn.lock
$ execa git add package-lock.json
info Installing CocoaPods dependencies (this may take a few minutes)
info Running \\"git status\\" to check what changed...
$ execa git status
success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
`;

exports[`Upgrade tests for react-native repo fetches regular patch, adds remote, applies patch, installs deps, removes remote, 1`] = `
"info Fetching diff between v0.57.8 and v0.58.4...
[fs] write tmp-upgrade-rn.patch
$ execa git rev-parse --show-prefix
$ execa git apply --binary --check tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
info Applying diff...
$ execa git apply tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
[fs] unlink tmp-upgrade-rn.patch
$ execa git status -s
info Installing \\"react-native@0.58.4\\" and its peer dependencies...
$ execa npm info react-native@0.58.4 peerDependencies --json
$ yarn add react-native@0.58.4 react@16.6.3
$ execa git add package.json
$ execa git add yarn.lock
$ execa git add package-lock.json
info Installing CocoaPods dependencies (this may take a few minutes)
info Running \\"git status\\" to check what changed...
$ execa git status
success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
`;

exports[`Upgrade tests for react-native repo fetches regular patch, adds remote, applies patch, installs deps, removes remote,: RnDiffApp is replaced with app name (TestApp and com.testapp) 1`] = `
"Snapshot Diff:
- First value
+ Second value
Expand Down Expand Up @@ -42,7 +124,7 @@ exports[`fetches regular patch, adds remote, applies patch, installs deps, remov
"
`;

exports[`works with --name-ios and --name-android: RnDiffApp is replaced with app name (CustomIos and co.uk.customandroid.app) 1`] = `
exports[`Upgrade tests for react-native repo works with --name-ios and --name-android: RnDiffApp is replaced with app name (CustomIos and co.uk.customandroid.app) 1`] = `
"Snapshot Diff:
- First value
+ Second value
Expand Down
Loading