Files
react-native-code-push/test/template/scenarios/scenarioRestart.js
scottbommarito 7ae7b48eac server url pls
2016-05-13 17:22:34 -07:00

19 lines
660 B
JavaScript

var CodePushWrapper = require("../codePushWrapper.js");
import CodePush from "react-native-code-push";
module.exports = {
startTest: function(testApp) {
testApp.sendCurrentAndPendingPackage()
.then(() => {
CodePushWrapper.sync(testApp, (status) => {
if (status === CodePush.SyncStatus.UPDATE_INSTALLED) {
testApp.sendCurrentAndPendingPackage().then(CodePush.restartApp);
}
}, undefined, { installMode: CodePush.InstallMode.ON_NEXT_RESTART });
});
},
getScenarioName: function() {
return "Restart";
}
};