You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2017/06/22 17:34:42 UTC
[11/14] cordova-lib git commit: nest certain plugin-remove-save tests
into a describe to better reflect structure
nest certain plugin-remove-save tests into a describe to better reflect structure
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/e314d073
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/e314d073
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/e314d073
Branch: refs/heads/master
Commit: e314d0736885fe96384f3804ecc2b579999637d3
Parents: 4c8563c
Author: filmaj <ma...@gmail.com>
Authored: Tue Jun 20 14:43:22 2017 -0500
Committer: filmaj <ma...@gmail.com>
Committed: Wed Jun 21 14:58:28 2017 -0500
----------------------------------------------------------------------
integration-tests/plugin_fetch.spec.js | 4 +++-
spec-cordova/plugin/remove.spec.js | 6 ++++--
src/cordova/plugin/add.js | 4 ++--
src/cordova/plugin/remove.js | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/e314d073/integration-tests/plugin_fetch.spec.js
----------------------------------------------------------------------
diff --git a/integration-tests/plugin_fetch.spec.js b/integration-tests/plugin_fetch.spec.js
index 6bf5501..1e171c5 100644
--- a/integration-tests/plugin_fetch.spec.js
+++ b/integration-tests/plugin_fetch.spec.js
@@ -17,7 +17,9 @@
under the License.
*/
-var plugin = require('../src/cordova/plugin'),
+// TODO: all of these tests should go as unit tests to src/cordova/plugin/add
+
+var plugin = require('../src/cordova/plugin/add'),
helpers = require('../spec-cordova/helpers'),
path = require('path'),
events = require('cordova-common').events,
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/e314d073/spec-cordova/plugin/remove.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/remove.spec.js b/spec-cordova/plugin/remove.spec.js
index 5101fb9..cbe1747 100644
--- a/spec-cordova/plugin/remove.spec.js
+++ b/spec-cordova/plugin/remove.spec.js
@@ -30,8 +30,10 @@ describe('cordova/plugin/remove', function () {
it('should call plugman.uninstall.uninstallPlatform for each platform installed in the project and for each provided plugin');
it('should trigger a prepare if plugman.uninstall.uninstallPlatform returned something falsy');
it('should call plugman.uninstall.uninstallPlugin once plugin has been uninstalled for each platform');
- it('should remove provided plugins from config.xml');
- it('should remove provided plugins from package.json (if exists)');
+ describe('when save option is provided or autosave config is on', function () {
+ it('should remove provided plugins from config.xml');
+ it('should remove provided plugins from package.json (if exists)');
+ });
it('should remove fetch metadata from fetch.json');
it('should fire the after_plugin_rm hook');
});
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/e314d073/src/cordova/plugin/add.js
----------------------------------------------------------------------
diff --git a/src/cordova/plugin/add.js b/src/cordova/plugin/add.js
index 346e688..ca12612 100644
--- a/src/cordova/plugin/add.js
+++ b/src/cordova/plugin/add.js
@@ -215,7 +215,7 @@ function add (projectRoot, targets, hooksRunner, opts) {
// Need to require right here instead of doing this at the beginning of file
// otherwise tests are failing without any real reason.
// TODO: possible circular dependency?
- return require('./prepare').preparePlatforms(platformList, projectRoot, opts);
+ return require('../prepare').preparePlatforms(platformList, projectRoot, opts);
}).then(function () {
opts.cordova = { plugins: cordova_util.findPlugins(pluginPath) };
return hooksRunner.fire('after_plugin_add', opts);
@@ -299,7 +299,7 @@ function determinePluginTarget (projectRoot, cfg, target, fetchOptions) {
// TODO: whoa wat
return (shouldUseNpmInfo ? registry.info([id])
.then(function (pluginInfo) {
- return getFetchVersion(projectRoot, pluginInfo, cordovaVersion);
+ return module.exports.getFetchVersion(projectRoot, pluginInfo, cordovaVersion);
}) : Q(null))
.then(function (fetchVersion) {
return fetchVersion ? (id + '@' + fetchVersion) : target;
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/e314d073/src/cordova/plugin/remove.js
----------------------------------------------------------------------
diff --git a/src/cordova/plugin/remove.js b/src/cordova/plugin/remove.js
index 78a355e..01de6fb 100644
--- a/src/cordova/plugin/remove.js
+++ b/src/cordova/plugin/remove.js
@@ -112,7 +112,7 @@ function remove (projectRoot, targets, hooksRunner, opts) {
if (!shouldRunPrepare) {
return Q();
}
- return require('./prepare').preparePlatforms(platformList, projectRoot, opts);
+ return require('../prepare').preparePlatforms(platformList, projectRoot, opts);
}).then(function () {
opts.cordova = { plugins: cordova_util.findPlugins(pluginPath) };
return hooksRunner.fire('after_plugin_rm', opts);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org