Fix runner restart on package.js scan failure

cordova-plugins now passes
This commit is contained in:
David Glasser
2014-11-24 11:58:58 -08:00
parent 3b7459e62a
commit 3d8d5ce88c
2 changed files with 14 additions and 7 deletions

View File

@@ -304,7 +304,12 @@ _.extend(exports.ProjectContext.prototype, {
getProjectAndLocalPackagesWatchSet: function () {
var self = this;
var watchSet = self.getProjectWatchSet();
watchSet.merge(self.isopackCache.allLoadedLocalPackagesWatchSet);
// Include the loaded local packages (ie, the non-metadata files) but only
// if we've actually gotten to the buildLocalPackages step.
if (self.isopackCache) {
watchSet.merge(self.isopackCache.allLoadedLocalPackagesWatchSet);
}
return watchSet;
},
@@ -418,10 +423,6 @@ _.extend(exports.ProjectContext.prototype, {
localPackageSearchDirs: searchDirs,
explicitlyAddedLocalPackageDirs: self._explicitlyAddedLocalPackageDirs
});
if (buildmessage.jobHasMessages()) {
self.projectCatalog = null;
self.localCatalog = null;
}
});
self._completedStage = STAGE.INITIALIZE_CATALOG;

View File

@@ -124,9 +124,15 @@ selftest.define("change cordova plugins", function () {
run.waitSecs(2);
run.match("restarted");
// Introduce an error.
s.cp('packages/contains-cordova-plugin/package3.js', 'packages/contains-cordova-plugin/package.js');
run.waitSecs(2);
run.match("exact version");
// Fix the error.
s.cp('packages/contains-cordova-plugin/package2.js', 'packages/contains-cordova-plugin/package.js');
run.waitSecs(2);
run.match("restarted");
});
@@ -243,14 +249,14 @@ selftest.define("remove cordova plugins", function () {
run = s.run("remove", "cordova:blahblah");
run.matchErr("not in this project");
run.forbidAll("removed");
run.expectExit(0);
run.expectExit(1);
run = s.run("remove", "cordova:blahblah",
"cordova:org.apache.cordova.camera");
run.waitSecs(5);
run.matchErr("not in this project");
run.match("removed");
run.expectExit(0);
run.expectExit(1);
checkUserPlugins(s, []);
});