@@ -170,10 +170,12 @@ success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the
170170` ) ;
171171} ) ;
172172
173- test ( 'fetches regular patch, adds remote, applies patch, installs deps, removes remote,' , async ( ) => {
174- ( fetch : any ) . mockImplementation ( ( ) => Promise . resolve ( samplePatch ) ) ;
175- await upgrade . func ( [ newVersion ] , ctx , opts ) ;
176- expect ( flushOutput ( ) ) . toMatchInlineSnapshot ( `
173+ test (
174+ 'fetches regular patch, adds remote, applies patch, installs deps, removes remote,' ,
175+ async ( ) => {
176+ ( fetch : any ) . mockImplementation ( ( ) => Promise . resolve ( samplePatch ) ) ;
177+ await upgrade . func ( [ newVersion ] , ctx , opts ) ;
178+ expect ( flushOutput ( ) ) . toMatchInlineSnapshot ( `
177179"info Fetching diff between v0.57.8 and v0.58.4...
178180[fs] write tmp-upgrade-rn.patch
179181$ execa git rev-parse --show-prefix
@@ -192,18 +194,22 @@ info Running \\"git status\\" to check what changed...
192194$ execa git status
193195success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
194196` ) ;
195- expect (
196- snapshotDiff ( samplePatch , fs . writeFileSync . mock . calls [ 0 ] [ 1 ] , {
197- contextLines : 1 ,
198- } ) ,
199- ) . toMatchSnapshot ( 'RnDiffApp is replaced with app name (TestApp)' ) ;
200- } , 60000 ) ;
201- test ( 'fetches regular patch, adds remote, applies patch, installs deps, removes remote when updated from nested directory' , async ( ) => {
202- ( fetch : any ) . mockImplementation ( ( ) => Promise . resolve ( samplePatch ) ) ;
203- ( execa : any ) . mockImplementation ( mockExecaNested ) ;
204- const config = { ...ctx , root : '/project/root/NestedApp' } ;
205- await upgrade . func ( [ newVersion ] , config , opts ) ;
206- expect ( flushOutput ( ) ) . toMatchInlineSnapshot ( `
197+ expect (
198+ snapshotDiff ( samplePatch , fs . writeFileSync . mock . calls [ 0 ] [ 1 ] , {
199+ contextLines : 1 ,
200+ } ) ,
201+ ) . toMatchSnapshot ( 'RnDiffApp is replaced with app name (TestApp)' ) ;
202+ } ,
203+ 60000 ,
204+ ) ;
205+ test (
206+ 'fetches regular patch, adds remote, applies patch, installs deps, removes remote when updated from nested directory' ,
207+ async ( ) => {
208+ ( fetch : any ) . mockImplementation ( ( ) => Promise . resolve ( samplePatch ) ) ;
209+ ( execa : any ) . mockImplementation ( mockExecaNested ) ;
210+ const config = { ...ctx , root : '/project/root/NestedApp' } ;
211+ await upgrade . func ( [ newVersion ] , config , opts ) ;
212+ expect ( flushOutput ( ) ) . toMatchInlineSnapshot ( `
207213"info Fetching diff between v0.57.8 and v0.58.4...
208214[fs] write tmp-upgrade-rn.patch
209215$ execa git rev-parse --show-prefix
@@ -222,7 +228,9 @@ info Running \\"git status\\" to check what changed...
222228$ execa git status
223229success Upgraded React Native to v0.58.4 🎉. Now you can review and commit the changes"
224230` ) ;
225- } , 60000 ) ;
231+ } ,
232+ 60000 ,
233+ ) ;
226234test ( 'cleans up if patching fails,' , async ( ) => {
227235 ( fetch : any ) . mockImplementation ( ( ) => Promise . resolve ( samplePatch ) ) ;
228236 ( execa : any ) . mockImplementation ( ( command , args ) => {
0 commit comments