Skip to content

Commit

Permalink
some tests are running!
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbommarito committed May 17, 2016
1 parent 7ae7b48 commit f09ab17
Show file tree
Hide file tree
Showing 5 changed files with 900 additions and 860 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class MainActivity extends ReactActivity {

@Override
protected String getJSBundleFile() {
return CodePush.getBundleUrl("index.android.bundle");
return CodePush.getBundleUrl();
}

/**
Expand Down
7 changes: 4 additions & 3 deletions test/template/codePushWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module.exports = {
install: function(testApp, onSuccess, onError, installMode, minBackgroundDuration, localPackage) {
return localPackage.install(installMode, minBackgroundDuration)
.then(() => {
testApp.installSuccess();
// Since immediate installs cannot be reliably logged, we only log "UPDATE_INSTALLED" if it is a resume or restart update.
if (installMode !== CodePush.InstallMode.IMMEDIATE) testApp.installSuccess();
return onSuccess && onSuccess();
}, () => {
testApp.installError();
Expand All @@ -39,8 +40,8 @@ module.exports = {
checkAndInstall: function(testApp, onSuccess, onError, installMode, minBackgroundDuration) {
return this.checkForUpdate(testApp,
this.download.bind(undefined, testApp,
this.install.bind(undefined, testApp, undefined, undefined, installMode, minBackgroundDuration),
undefined));
this.install.bind(undefined, testApp, onSuccess, onError, installMode, minBackgroundDuration),
onError));
},

sync: function(testApp, onSyncStatus, onSyncError, options) {
Expand Down
2 changes: 1 addition & 1 deletion test/template/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var TestCodePush = React.createClass({
checkUpdateSuccess(remotePackage) {
if (remotePackage) {
if (!remotePackage.failedInstall) {
this.setStateAndSendMessage("There is an update available. Remote package:" + JSON.stringify(remotePackage), "CHECK_UPDATE_AVAILABLE");
this.setStateAndSendMessage("There is an update available. Remote package:" + JSON.stringify(remotePackage), "CHECK_UPDATE_AVAILABLE", [remotePackage]);
} else {
this.setStateAndSendMessage("An update is available but failed previously. Remote package:" + JSON.stringify(remotePackage), "UPDATE_FAILED_PREVIOUSLY");
}
Expand Down
3 changes: 2 additions & 1 deletion test/template/scenarios/scenarioInstall.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
var CodePushWrapper = require("../codePushWrapper.js");
import CodePush from "react-native-code-push";

module.exports = {
startTest: function(testApp) {
CodePushWrapper.checkAndInstall(testApp);
CodePushWrapper.checkAndInstall(testApp, undefined, undefined, CodePush.InstallMode.IMMEDIATE);
},

getScenarioName: function() {
Expand Down
Loading

0 comments on commit f09ab17

Please sign in to comment.