@@ -159,16 +159,16 @@ test('fetches empty patch and installs deps', async () => {
159
159
( fetch : any ) . mockImplementation ( ( ) => Promise . resolve ( '' ) ) ;
160
160
await upgrade . func ( [ newVersion ] , ctx , opts ) ;
161
161
expect ( flushOutput ( ) ) . toMatchInlineSnapshot ( `
162
- "info Fetching diff between v0.57.8 and v0.58.4...
163
- info Diff has no changes to apply, proceeding further
164
- info Installing \\"[email protected] \\" and its peer dependencies...
165
- $ execa npm info [email protected] peerDependencies --json
166
-
167
- $ execa git add package.json
168
- $ execa git add yarn.lock
169
- $ execa git add package-lock.json
170
- success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
171
- ` ) ;
162
+ "info Fetching diff between v0.57.8 and v0.58.4...
163
+ info Diff has no changes to apply, proceeding further
164
+ info Installing \\"[email protected] \\" and its peer dependencies...
165
+ $ execa npm info [email protected] peerDependencies --json
166
+
167
+ $ execa git add package.json
168
+ $ execa git add yarn.lock
169
+ $ execa git add package-lock.json
170
+ success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
171
+ `) ;
172
172
} , 60000 ) ;
173
173
174
174
test ( 'fetches regular patch, adds remote, applies patch, installs deps, removes remote,' , async ( ) => {
@@ -184,24 +184,24 @@ test('fetches regular patch, adds remote, applies patch, installs deps, removes
184
184
opts ,
185
185
) ;
186
186
expect ( flushOutput ( ) ) . toMatchInlineSnapshot ( `
187
- "info Fetching diff between v0.57.8 and v0.58.4...
188
- [fs] write tmp-upgrade-rn.patch
189
- $ execa git rev-parse --show-prefix
190
- $ execa git apply --check tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
191
- info Applying diff...
192
- $ execa git apply tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
193
- [fs] unlink tmp-upgrade-rn.patch
194
- $ execa git status -s
195
- info Installing \\"[email protected] \\" and its peer dependencies...
196
- $ execa npm info [email protected] peerDependencies --json
197
-
198
- $ execa git add package.json
199
- $ execa git add yarn.lock
200
- $ execa git add package-lock.json
201
- info Running \\"git status\\" to check what changed...
202
- $ execa git status
203
- success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
204
- ` ) ;
187
+ "info Fetching diff between v0.57.8 and v0.58.4...
188
+ [fs] write tmp-upgrade-rn.patch
189
+ $ execa git rev-parse --show-prefix
190
+ $ execa git apply --check tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
191
+ info Applying diff...
192
+ $ execa git apply tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
193
+ [fs] unlink tmp-upgrade-rn.patch
194
+ $ execa git status -s
195
+ info Installing \\"[email protected] \\" and its peer dependencies...
196
+ $ execa npm info [email protected] peerDependencies --json
197
+
198
+ $ execa git add package.json
199
+ $ execa git add yarn.lock
200
+ $ execa git add package-lock.json
201
+ info Running \\"git status\\" to check what changed...
202
+ $ execa git status
203
+ success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
204
+ `) ;
205
205
expect (
206
206
snapshotDiff ( samplePatch , fs . writeFileSync . mock . calls [ 0 ] [ 1 ] , {
207
207
contextLines : 1 ,
@@ -216,24 +216,24 @@ test('fetches regular patch, adds remote, applies patch, installs deps, removes
216
216
const config = { ...ctx , root : '/project/root/NestedApp' } ;
217
217
await upgrade . func ( [ newVersion ] , config , opts ) ;
218
218
expect ( flushOutput ( ) ) . toMatchInlineSnapshot ( `
219
- "info Fetching diff between v0.57.8 and v0.58.4...
220
- [fs] write tmp-upgrade-rn.patch
221
- $ execa git rev-parse --show-prefix
222
- $ execa git apply --check tmp-upgrade-rn.patch --exclude=NestedApp/package.json -p2 --3way --directory=NestedApp/
223
- info Applying diff...
224
- $ execa git apply tmp-upgrade-rn.patch --exclude=NestedApp/package.json -p2 --3way --directory=NestedApp/
225
- [fs] unlink tmp-upgrade-rn.patch
226
- $ execa git status -s
227
- info Installing \\"[email protected] \\" and its peer dependencies...
228
- $ execa npm info [email protected] peerDependencies --json
229
-
230
- $ execa git add package.json
231
- $ execa git add yarn.lock
232
- $ execa git add package-lock.json
233
- info Running \\"git status\\" to check what changed...
234
- $ execa git status
235
- success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
236
- ` ) ;
219
+ "info Fetching diff between v0.57.8 and v0.58.4...
220
+ [fs] write tmp-upgrade-rn.patch
221
+ $ execa git rev-parse --show-prefix
222
+ $ execa git apply --check tmp-upgrade-rn.patch --exclude=NestedApp/package.json -p2 --3way --directory=NestedApp/
223
+ info Applying diff...
224
+ $ execa git apply tmp-upgrade-rn.patch --exclude=NestedApp/package.json -p2 --3way --directory=NestedApp/
225
+ [fs] unlink tmp-upgrade-rn.patch
226
+ $ execa git status -s
227
+ info Installing \\"[email protected] \\" and its peer dependencies...
228
+ $ execa npm info [email protected] peerDependencies --json
229
+
230
+ $ execa git add package.json
231
+ $ execa git add yarn.lock
232
+ $ execa git add package-lock.json
233
+ info Running \\"git status\\" to check what changed...
234
+ $ execa git status
235
+ success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
236
+ `) ;
237
237
} , 60000 ) ;
238
238
test ( 'cleans up if patching fails,' , async ( ) => {
239
239
( fetch : any ) . mockImplementation ( ( ) => Promise . resolve ( samplePatch ) ) ;
@@ -263,22 +263,22 @@ test('cleans up if patching fails,', async () => {
263
263
) ;
264
264
}
265
265
expect ( flushOutput ( ) ) . toMatchInlineSnapshot ( `
266
- "info Fetching diff between v0.57.8 and v0.58.4...
267
- [fs] write tmp-upgrade-rn.patch
268
- $ execa git rev-parse --show-prefix
269
- $ execa git apply --check tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
270
- info Applying diff (excluding: package.json, .flowconfig)...
271
- $ execa git apply tmp-upgrade-rn.patch --exclude=package.json --exclude=.flowconfig -p2 --3way --directory=
272
- error: .flowconfig: does not exist in index
273
- error Automatically applying diff failed
274
- [fs] unlink tmp-upgrade-rn.patch
275
- $ execa git status -s
276
- error Patch failed to apply for unknown reason. Please fall back to manual way of upgrading
277
- info You may find these resources helpful:
278
- • Release notes: https://github.com/facebook/react-native/releases/tag/v0.58.4
279
- • Comparison between versions: https://github.com/react-native-community/rn-diff-purge/compare/version /0.57.8..version /0.58.4
280
- • Git diff: https://github. com/react-native-community/rn-diff-purge/compare/version /0.57.8..version/ 0.58.4.diff"
281
- ` ) ;
266
+ "info Fetching diff between v0.57.8 and v0.58.4...
267
+ [fs] write tmp-upgrade-rn.patch
268
+ $ execa git rev-parse --show-prefix
269
+ $ execa git apply --check tmp-upgrade-rn.patch --exclude=package.json -p2 --3way --directory=
270
+ info Applying diff (excluding: package.json, .flowconfig)...
271
+ $ execa git apply tmp-upgrade-rn.patch --exclude=package.json --exclude=.flowconfig -p2 --3way --directory=
272
+ error: .flowconfig: does not exist in index
273
+ error Automatically applying diff failed
274
+ [fs] unlink tmp-upgrade-rn.patch
275
+ $ execa git status -s
276
+ error Patch failed to apply for unknown reason. Please fall back to manual way of upgrading
277
+ info You may find these resources helpful:
278
+ • Release notes: https://github.com/facebook/react-native/releases/tag/v0.58.4
279
+ • Comparison between versions: https://github.com/react-native-community/rn-diff-purge/compare/release /0.57.8..release /0.58.4
280
+ • Git diff: https://raw.githubusercontent. com/react-native-community/rn-diff-purge/diffs/diffs /0.57.8..0.58.4.diff"
281
+ `) ;
282
282
} , 60000 ) ;
283
283
test ( 'works with --name-ios and --name-android' , async ( ) => {
284
284
( fetch : any ) . mockImplementation ( ( ) => Promise . resolve ( samplePatch ) ) ;
0 commit comments