@@ -472,6 +472,7 @@ const ScenarioSyncResumeDelay = "scenarioSyncResumeDelay.js";
472
472
const ScenarioSyncRestartDelay = "scenarioSyncResumeDelay.js" ;
473
473
const ScenarioSync2x = "scenarioSync2x.js" ;
474
474
const ScenarioRestart = "scenarioRestart.js" ;
475
+ const ScenarioRestart2x = "scenarioRestart2x.js" ;
475
476
const ScenarioSyncMandatoryDefault = "scenarioSyncMandatoryDefault.js" ;
476
477
const ScenarioSyncMandatoryResume = "scenarioSyncMandatoryResume.js" ;
477
478
const ScenarioSyncMandatoryRestart = "scenarioSyncMandatoryRestart.js" ;
@@ -989,11 +990,28 @@ PluginTestingFramework.initializeTests(new RNProjectManager(), supportedTargetPl
989
990
990
991
TestBuilder . describe ( "#codePush.restartApplication.2x" ,
991
992
( ) => {
992
- TestBuilder . it ( "with pending update" , false ,
993
+ // TestBuilder.it("blocks when a restart is in progress and doesn't crash if there is a pending package", false,
994
+ // (done: MochaDone) => {
995
+ // ServerUtil.updateResponse = { updateInfo: ServerUtil.createUpdateResponse(false, targetPlatform) };
996
+ // setupTestRunScenario(projectManager, targetPlatform, ScenarioInstallRestart2x)
997
+ // .then(setupUpdateScenario.bind(this, projectManager, targetPlatform, UpdateDeviceReady, "Good Update"))
998
+ // .then<void>((updatePath: string) => {
999
+ // ServerUtil.updatePackagePath = updatePath;
1000
+ // projectManager.runApplication(TestConfig.testRunDirectory, targetPlatform);
1001
+ // return ServerUtil.expectTestMessages([
1002
+ // ServerUtil.TestMessage.CHECK_UPDATE_AVAILABLE,
1003
+ // ServerUtil.TestMessage.DOWNLOAD_SUCCEEDED,
1004
+ // ServerUtil.TestMessage.UPDATE_INSTALLED,
1005
+ // ServerUtil.TestMessage.DEVICE_READY_AFTER_UPDATE]);
1006
+ // })
1007
+ // .done(() => { done(); }, (e) => { done(e); });
1008
+ // });
1009
+
1010
+ TestBuilder . it ( "doesn't block when the restart is ignored" , false ,
993
1011
( done : MochaDone ) => {
994
1012
ServerUtil . updateResponse = { updateInfo : ServerUtil . createUpdateResponse ( false , targetPlatform ) } ;
995
-
996
- setupUpdateScenario ( projectManager , targetPlatform , UpdateDeviceReady , "Update 1" )
1013
+ setupTestRunScenario ( projectManager , targetPlatform , ScenarioRestart2x )
1014
+ . then ( setupUpdateScenario . bind ( this , projectManager , targetPlatform , UpdateDeviceReady , "Good Update" ) )
997
1015
. then < void > ( ( updatePath : string ) => {
998
1016
ServerUtil . updatePackagePath = updatePath ;
999
1017
projectManager . runApplication ( TestConfig . testRunDirectory , targetPlatform ) ;
@@ -1005,7 +1023,7 @@ PluginTestingFramework.initializeTests(new RNProjectManager(), supportedTargetPl
1005
1023
} )
1006
1024
. done ( ( ) => { done ( ) ; } , ( e ) => { done ( e ) ; } ) ;
1007
1025
} ) ;
1008
- } , ScenarioInstallRestart2x ) ;
1026
+ } ) ;
1009
1027
1010
1028
TestBuilder . describe ( "#window.codePush.sync" ,
1011
1029
( ) => {
0 commit comments