cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [08/14] cordova-lib git commit: removing unnecessary else from plugin remove. moved plugin-package-parse to plugin subdir and renamed to plugin_spec_parser (to reflect name of module under test).
Date Thu, 22 Jun 2017 17:34:39 GMT
removing unnecessary else from plugin remove. moved plugin-package-parse to plugin subdir and
renamed to plugin_spec_parser (to reflect name of module under test).


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/ba6b57df
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/ba6b57df
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/ba6b57df

Branch: refs/heads/master
Commit: ba6b57df83d0ea7a170bcd5c595d4556868068ab
Parents: 04c12e2
Author: filmaj <maj.fil@gmail.com>
Authored: Mon Jun 19 23:56:02 2017 -0500
Committer: filmaj <maj.fil@gmail.com>
Committed: Wed Jun 21 14:58:14 2017 -0500

----------------------------------------------------------------------
 spec-cordova/plugin/plugin_spec_parser.spec.js | 59 +++++++++++++++++++++
 spec-cordova/plugin_package_parse.spec.js      | 59 ---------------------
 src/cordova/plugin/remove.js                   |  3 --
 3 files changed, 59 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ba6b57df/spec-cordova/plugin/plugin_spec_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/plugin_spec_parser.spec.js b/spec-cordova/plugin/plugin_spec_parser.spec.js
new file mode 100644
index 0000000..e5224e4
--- /dev/null
+++ b/spec-cordova/plugin/plugin_spec_parser.spec.js
@@ -0,0 +1,59 @@
+/**
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+/* eslint-env jasmine */
+
+var pluginSpec = require('../../src/cordova/plugin/plugin_spec_parser');
+
+describe('methods for parsing npm plugin packages', function () {
+    function checkPluginSpecParsing (testString, scope, id, version) {
+        var parsedSpec = pluginSpec.parse(testString);
+        expect(parsedSpec.scope).toEqual(scope);
+        expect(parsedSpec.id).toEqual(id || testString);
+        expect(parsedSpec.version).toEqual(version);
+        expect(parsedSpec.package).toEqual(scope ? scope + id : id);
+    }
+
+    it('Test 001 : should handle package names with no scope or version', function () {
+        checkPluginSpecParsing('test-plugin', null, 'test-plugin', null);
+    });
+    it('Test 002 : should handle package names with a version', function () {
+        checkPluginSpecParsing('test-plugin@1.0.0', null, 'test-plugin', '1.0.0');
+        checkPluginSpecParsing('test-plugin@latest', null, 'test-plugin', 'latest');
+    });
+    it('Test 003 : should handle package names with a scope', function () {
+        checkPluginSpecParsing('@test/test-plugin', '@test/', 'test-plugin', null);
+    });
+    it('Test 004 : should handle package names with a scope and a version', function () {
+        checkPluginSpecParsing('@test/test-plugin@1.0.0', '@test/', 'test-plugin', '1.0.0');
+        checkPluginSpecParsing('@test/test-plugin@latest', '@test/', 'test-plugin', 'latest');
+    });
+    it('Test 005 : should handle invalid package specs', function () {
+        checkPluginSpecParsing('@nonsense', null, null, null);
+        checkPluginSpecParsing('@/nonsense', null, null, null);
+        checkPluginSpecParsing('@', null, null, null);
+        checkPluginSpecParsing('@nonsense@latest', null, null, null);
+        checkPluginSpecParsing('@/@', null, null, null);
+        checkPluginSpecParsing('/', null, null, null);
+        checkPluginSpecParsing('../../@directory', null, null, null);
+        checkPluginSpecParsing('@directory/../@directory', null, null, null);
+        checkPluginSpecParsing('./directory', null, null, null);
+        checkPluginSpecParsing('directory/directory', null, null, null);
+        checkPluginSpecParsing('http://cordova.apache.org', null, null, null);
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ba6b57df/spec-cordova/plugin_package_parse.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin_package_parse.spec.js b/spec-cordova/plugin_package_parse.spec.js
deleted file mode 100644
index 25a75d4..0000000
--- a/spec-cordova/plugin_package_parse.spec.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-/* eslint-env jasmine */
-
-var pluginSpec = require('../src/cordova/plugin/plugin_spec_parser');
-
-describe('methods for parsing npm plugin packages', function () {
-    function checkPluginSpecParsing (testString, scope, id, version) {
-        var parsedSpec = pluginSpec.parse(testString);
-        expect(parsedSpec.scope).toEqual(scope);
-        expect(parsedSpec.id).toEqual(id || testString);
-        expect(parsedSpec.version).toEqual(version);
-        expect(parsedSpec.package).toEqual(scope ? scope + id : id);
-    }
-
-    it('Test 001 : should handle package names with no scope or version', function () {
-        checkPluginSpecParsing('test-plugin', null, 'test-plugin', null);
-    });
-    it('Test 002 : should handle package names with a version', function () {
-        checkPluginSpecParsing('test-plugin@1.0.0', null, 'test-plugin', '1.0.0');
-        checkPluginSpecParsing('test-plugin@latest', null, 'test-plugin', 'latest');
-    });
-    it('Test 003 : should handle package names with a scope', function () {
-        checkPluginSpecParsing('@test/test-plugin', '@test/', 'test-plugin', null);
-    });
-    it('Test 004 : should handle package names with a scope and a version', function () {
-        checkPluginSpecParsing('@test/test-plugin@1.0.0', '@test/', 'test-plugin', '1.0.0');
-        checkPluginSpecParsing('@test/test-plugin@latest', '@test/', 'test-plugin', 'latest');
-    });
-    it('Test 005 : should handle invalid package specs', function () {
-        checkPluginSpecParsing('@nonsense', null, null, null);
-        checkPluginSpecParsing('@/nonsense', null, null, null);
-        checkPluginSpecParsing('@', null, null, null);
-        checkPluginSpecParsing('@nonsense@latest', null, null, null);
-        checkPluginSpecParsing('@/@', null, null, null);
-        checkPluginSpecParsing('/', null, null, null);
-        checkPluginSpecParsing('../../@directory', null, null, null);
-        checkPluginSpecParsing('@directory/../@directory', null, null, null);
-        checkPluginSpecParsing('./directory', null, null, null);
-        checkPluginSpecParsing('directory/directory', null, null, null);
-        checkPluginSpecParsing('http://cordova.apache.org', null, null, null);
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ba6b57df/src/cordova/plugin/remove.js
----------------------------------------------------------------------
diff --git a/src/cordova/plugin/remove.js b/src/cordova/plugin/remove.js
index 9579fee..ca27601 100644
--- a/src/cordova/plugin/remove.js
+++ b/src/cordova/plugin/remove.js
@@ -90,9 +90,6 @@ function remove (projectRoot, targets, hooksRunner, opts) {
                     if (fs.existsSync(pkgJsonPath)) {
                         // delete any previous caches of require(package.json)
                         pkgJson = cordova_util.requireNoCache(pkgJsonPath);
-                    } else {
-                        // TODO: well this comment below seems kinda importnat
-                        // Create package.json in cordova@7
                     }
                     // If package.json exists and contains a specified plugin in cordova['plugins'],
it will be removed
                     if (pkgJson !== undefined && pkgJson.cordova !== undefined &&
pkgJson.cordova.plugins !== undefined) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message