mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-19 19:39:54 +08:00
fixes issue
This commit is contained in:
17
test/template/scenarios/scenarioInstallRestart2x.js
Normal file
17
test/template/scenarios/scenarioInstallRestart2x.js
Normal file
@@ -0,0 +1,17 @@
|
||||
var CodePushWrapper = require("../codePushWrapper.js");
|
||||
import CodePush from "react-native-code-push";
|
||||
|
||||
module.exports = {
|
||||
startTest: function(testApp) {
|
||||
CodePushWrapper.checkAndInstall(testApp,
|
||||
() => {
|
||||
CodePush.restartApp();
|
||||
CodePush.restartApp();
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
getScenarioName: function() {
|
||||
return "Install and Restart 2x";
|
||||
}
|
||||
};
|
||||
21
test/test.ts
21
test/test.ts
@@ -465,6 +465,7 @@ const ScenarioInstall = "scenarioInstall.js";
|
||||
const ScenarioInstallOnResumeWithRevert = "scenarioInstallOnResumeWithRevert.js";
|
||||
const ScenarioInstallOnRestartWithRevert = "scenarioInstallOnRestartWithRevert.js";
|
||||
const ScenarioInstallWithRevert = "scenarioInstallWithRevert.js";
|
||||
const ScenarioInstallRestart2x = "scenarioInstallRestart2x.js";
|
||||
const ScenarioSync1x = "scenarioSync.js";
|
||||
const ScenarioSyncResume = "scenarioSyncResume.js";
|
||||
const ScenarioSyncResumeDelay = "scenarioSyncResumeDelay.js";
|
||||
@@ -986,6 +987,26 @@ PluginTestingFramework.initializeTests(new RNProjectManager(), supportedTargetPl
|
||||
});
|
||||
}, ScenarioRestart);
|
||||
|
||||
TestBuilder.describe("#codePush.restartApplication.2x",
|
||||
() => {
|
||||
TestBuilder.it("with pending update", false,
|
||||
(done: MochaDone) => {
|
||||
ServerUtil.updateResponse = { updateInfo: ServerUtil.createUpdateResponse(false, targetPlatform) };
|
||||
|
||||
setupUpdateScenario(projectManager, targetPlatform, UpdateDeviceReady, "Update 1")
|
||||
.then<void>((updatePath: string) => {
|
||||
ServerUtil.updatePackagePath = updatePath;
|
||||
projectManager.runApplication(TestConfig.testRunDirectory, targetPlatform);
|
||||
return ServerUtil.expectTestMessages([
|
||||
ServerUtil.TestMessage.CHECK_UPDATE_AVAILABLE,
|
||||
ServerUtil.TestMessage.DOWNLOAD_SUCCEEDED,
|
||||
ServerUtil.TestMessage.UPDATE_INSTALLED,
|
||||
ServerUtil.TestMessage.DEVICE_READY_AFTER_UPDATE]);
|
||||
})
|
||||
.done(() => { done(); }, (e) => { done(e); });
|
||||
});
|
||||
}, ScenarioInstallRestart2x);
|
||||
|
||||
TestBuilder.describe("#window.codePush.sync",
|
||||
() => {
|
||||
// We test the functionality with sync twice--first, with sync only called once,
|
||||
|
||||
Reference in New Issue
Block a user