You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2017/01/18 01:56:49 UTC

[32/50] [abbrv] cordova-lib git commit: fixjasmine : CB-12018 : updated jasmine tests after final review

fixjasmine : CB-12018 : updated jasmine tests after final review

 This closes #510


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

Branch: refs/heads/fetch-1.0.x
Commit: 1818532a09ca89a418ee097b2b2778131966ff73
Parents: 159b534
Author: audreyso <au...@adobe.com>
Authored: Wed Jan 11 09:21:38 2017 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Wed Jan 11 17:26:59 2017 -0800

----------------------------------------------------------------------
 cordova-common/spec/ActionStack.spec.js            |  2 +-
 cordova-common/spec/CordovaCheck.spec.js           |  6 +++---
 cordova-lib/spec-cordova/plugin.spec.js            | 13 -------------
 cordova-lib/spec-plugman/create.spec.js            |  1 +
 cordova-lib/spec-plugman/install.spec.js           |  4 ++--
 cordova-lib/spec-plugman/platforms/windows.spec.js |  6 ------
 6 files changed, 7 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1818532a/cordova-common/spec/ActionStack.spec.js
----------------------------------------------------------------------
diff --git a/cordova-common/spec/ActionStack.spec.js b/cordova-common/spec/ActionStack.spec.js
index e0b7d7d..80d6c4d 100644
--- a/cordova-common/spec/ActionStack.spec.js
+++ b/cordova-common/spec/ActionStack.spec.js
@@ -60,7 +60,7 @@ describe('action-stack', function() {
             // process should throw
             var error;
             stack.process('android', android_one_project)
-            .then(function(something){
+            .then(function(){
                 expect(false).toBe(true);
             }).fail(function(err){
                 error = err;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1818532a/cordova-common/spec/CordovaCheck.spec.js
----------------------------------------------------------------------
diff --git a/cordova-common/spec/CordovaCheck.spec.js b/cordova-common/spec/CordovaCheck.spec.js
index abaaa14..8745a40 100644
--- a/cordova-common/spec/CordovaCheck.spec.js
+++ b/cordova-common/spec/CordovaCheck.spec.js
@@ -30,9 +30,9 @@ describe('findProjectRoot method', function() {
         process.env.PWD = origPWD;
         process.chdir(cwd);
     });
-function removeDir(someDirectory) {
-    shell.rm('-rf', someDirectory);
-}
+    function removeDir(someDirectory) {
+        shell.rm('-rf', someDirectory);
+    }
     it('Test 001 : should return false if it hits the home directory', function() {
         var somedir = path.join(home, 'somedir');
         removeDir(somedir);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1818532a/cordova-lib/spec-cordova/plugin.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/plugin.spec.js b/cordova-lib/spec-cordova/plugin.spec.js
index 3441ce1..f81f863 100644
--- a/cordova-lib/spec-cordova/plugin.spec.js
+++ b/cordova-lib/spec-cordova/plugin.spec.js
@@ -83,7 +83,6 @@ function removePlugin(id) {
 var errorHandler = {
     errorCallback: function(error) {
         // We want the error to be printed by jasmine
-        console.log(error);
         expect(error).toBeUndefined();
     }
 };
@@ -152,7 +151,6 @@ describe('plugin end-to-end', function() {
             return removePlugin(pluginId);
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -169,7 +167,6 @@ describe('plugin end-to-end', function() {
             expect(prepare.preparePlatforms).toHaveBeenCalled();
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -186,7 +183,6 @@ describe('plugin end-to-end', function() {
             expect(prepare.preparePlatforms).not.toHaveBeenCalled();
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -210,7 +206,6 @@ describe('plugin end-to-end', function() {
             return removePlugin(pluginId);
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -230,7 +225,6 @@ describe('plugin end-to-end', function() {
             return removePlugin(org_test_defaultvariables);
        })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -239,7 +233,6 @@ describe('plugin end-to-end', function() {
     it('Test 006 : should successfully add a plugin when specifying CLI variables', function(done) {
         addPlugin(path.join(pluginsDir, org_test_defaultvariables), org_test_defaultvariables, {cli_variables: { REQUIRED:'yes', REQUIRED_ANDROID:'yes'}}, done)
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -255,7 +248,6 @@ describe('plugin end-to-end', function() {
             expect(fetchOptions.searchpath[0]).toExist();
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -273,7 +265,6 @@ describe('plugin end-to-end', function() {
             expect(fetchOptions.noregistry).toBeTruthy();
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -286,7 +277,6 @@ describe('plugin end-to-end', function() {
             expect(registry.info).not.toHaveBeenCalled();
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -304,7 +294,6 @@ describe('plugin end-to-end', function() {
             expect(fetchTarget).toEqual(npmInfoTestPlugin + '@' + npmInfoTestPluginVersion);
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -326,7 +315,6 @@ describe('plugin end-to-end', function() {
             expect(fetchTarget).toEqual(scopedPackage);
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);
@@ -345,7 +333,6 @@ describe('plugin end-to-end', function() {
             expect(fetchTarget).toEqual(scopedPackage);
         })
         .fail(function(err) {
-            console.error(err);
             expect(err).toBeUndefined();
         })
         .fin(done);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1818532a/cordova-lib/spec-plugman/create.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/create.spec.js b/cordova-lib/spec-plugman/create.spec.js
index 524a5ce..64b0cdc 100644
--- a/cordova-lib/spec-plugman/create.spec.js
+++ b/cordova-lib/spec-plugman/create.spec.js
@@ -49,6 +49,7 @@ describe( 'create plugin', function() {
             expect( writeFileSync.calls.count() ).toEqual( 2 );
             done();
         }).fail(function err(errMsg) {
+            expect(errMsg).toBeUndefined();
             done();
         });
     }, 6000);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1818532a/cordova-lib/spec-plugman/install.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/install.spec.js b/cordova-lib/spec-plugman/install.spec.js
index 3f2b7da..4e486f0 100644
--- a/cordova-lib/spec-plugman/install.spec.js
+++ b/cordova-lib/spec-plugman/install.spec.js
@@ -213,7 +213,7 @@ describe('install', function() {
             spyOn(fs, 'existsSync').and.callFake( fake['existsSync']['noPlugins'] );
             install('android', project, 'CLEANYOURSHORTS')
             .fail(function(err){
-                console.log(err);
+                expect(err).toBeUndefined();
             })
             .fin(function () {
                 expect(fetchSpy).toHaveBeenCalled();
@@ -230,7 +230,7 @@ describe('install', function() {
                 return true;
             })
             .fail(function(err){
-                console.log(err);
+                expect(err).toBeUndefined();
             })
             .fin(function () {
                 expect(emit.calls.argsFor(0)[1]).toBe('Notice: org.apache.cordova.device has been automatically converted to cordova-plugin-device and fetched from npm. This is due to our old plugins registry shutting down.');

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1818532a/cordova-lib/spec-plugman/platforms/windows.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platforms/windows.spec.js b/cordova-lib/spec-plugman/platforms/windows.spec.js
index 5b68c3d..3528a2e 100644
--- a/cordova-lib/spec-plugman/platforms/windows.spec.js
+++ b/cordova-lib/spec-plugman/platforms/windows.spec.js
@@ -131,8 +131,6 @@ beforeEach(function () {
             });
 
             function validateInstalledProjects(tag, elementToInstall, xpath, supportedPlatforms) {
-                //jasmine.getEnv().currentSpec.removeAllSpies();
-                
 
                 var projects = copyArray(proj_files.projects);
                 if (platform === 'windows') {
@@ -203,12 +201,10 @@ beforeEach(function () {
 
                 projectsAddedToSpies.forEach(function (spy) {
                     expect(spy).toHaveBeenCalled();
-                    spy.calls.reset();
                 });
 
                 projectsNotAddedToSpies.forEach(function (spy) {
                     expect(spy).not.toHaveBeenCalled();
-                    spy.calls.reset();
                 });
             }
 
@@ -452,12 +448,10 @@ beforeEach(function () {
 
                 projectsAddedToSpies.forEach(function (spy) {
                     expect(spy).toHaveBeenCalledWith(xmlPath, incText, targetConditions);
-                    spy.calls.reset();
                 });
 
                 projectsNotAddedToSpies.forEach(function (spy) {
                     expect(spy).not.toHaveBeenCalled();
-                    spy.calls.reset();
                 });
             }
 


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