You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mm...@apache.org on 2014/04/24 20:30:36 UTC

[9/9] git commit: First working plugin test in new style

First working plugin test in new style


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

Branch: refs/heads/cdvtest
Commit: 7d614b920899e9dc442f6d5e44b307605e5f8fb8
Parents: a9b2849
Author: Michal Mocny <mm...@gmail.com>
Authored: Thu Apr 24 14:29:58 2014 -0400
Committer: Michal Mocny <mm...@gmail.com>
Committed: Thu Apr 24 14:29:58 2014 -0400

----------------------------------------------------------------------
 cordova-app-test-harness/.gitignore      |  2 ++
 cordova-app-test-harness/www/last_update |  2 +-
 cordova-app-test-harness/www/main.js     |  1 -
 cordova-app-test-harness/www/tests.js    | 19 +++++++++++++++++++
 4 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/7d614b92/cordova-app-test-harness/.gitignore
----------------------------------------------------------------------
diff --git a/cordova-app-test-harness/.gitignore b/cordova-app-test-harness/.gitignore
index c98dbcd..77cc947 100644
--- a/cordova-app-test-harness/.gitignore
+++ b/cordova-app-test-harness/.gitignore
@@ -1,2 +1,4 @@
 platforms
 plugins
+www/last_update
+node_modules

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/7d614b92/cordova-app-test-harness/www/last_update
----------------------------------------------------------------------
diff --git a/cordova-app-test-harness/www/last_update b/cordova-app-test-harness/www/last_update
index dbc315f..8884c8a 100644
--- a/cordova-app-test-harness/www/last_update
+++ b/cordova-app-test-harness/www/last_update
@@ -1 +1 @@
-Thu Apr 24 12:05:19 EDT 2014
+Thu Apr 24 12:18:00 EDT 2014

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/7d614b92/cordova-app-test-harness/www/main.js
----------------------------------------------------------------------
diff --git a/cordova-app-test-harness/www/main.js b/cordova-app-test-harness/www/main.js
index bdaaca9..256ac09 100644
--- a/cordova-app-test-harness/www/main.js
+++ b/cordova-app-test-harness/www/main.js
@@ -126,7 +126,6 @@ function startAutoReload() {
   var last_update = null;
   setInterval(function() {
     $.get('last_update', function(time) {
-      console.log(time);
       if (!last_update) {
         last_update = time;
         return;

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/7d614b92/cordova-app-test-harness/www/tests.js
----------------------------------------------------------------------
diff --git a/cordova-app-test-harness/www/tests.js b/cordova-app-test-harness/www/tests.js
index a5421d9..8a1f21f 100644
--- a/cordova-app-test-harness/www/tests.js
+++ b/cordova-app-test-harness/www/tests.js
@@ -26,6 +26,25 @@ exports.registerAutoTests = function(api, fn) {
 };
 
 exports.defineAutoTests = function(jasmineInterface) {
+  // one time
+  var test_modules = cordova.require('cordova/plugin_list')
+    .map(function(jsmodule) {
+      return jsmodule.id;
+    })
+    .filter(function(id) {
+      return /.tests$/.test(id);
+    });
+  test_modules.forEach(function(id) {
+    try {
+      // This runs the tests
+      cordova.require(id);
+    } catch(ex) {
+      logger('Failed to load:', id);
+      return;
+    }
+    logger('Loaded:', id);
+  });
+
   Object.keys(exports.tests).forEach(function(key) {
     if (!exports.tests[key].enabled)
       return;