cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject js commit: Disable urlutil tests under jsdom & set jsdom to file: to avoid hitting network
Date Wed, 07 May 2014 01:35:42 GMT
Repository: cordova-js
Updated Branches:
  refs/heads/master 81c6dbebb -> 4d1c898e2


Disable urlutil tests under jsdom & set jsdom to file: to avoid hitting network


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

Branch: refs/heads/master
Commit: 4d1c898e20f6adfdd2856e801e6981661abb57d0
Parents: 81c6dbe
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue May 6 21:35:08 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue May 6 21:35:08 2014 -0400

----------------------------------------------------------------------
 tasks/lib/test-jsdom.js | 2 +-
 test/test.urlutil.js    | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/4d1c898e/tasks/lib/test-jsdom.js
----------------------------------------------------------------------
diff --git a/tasks/lib/test-jsdom.js b/tasks/lib/test-jsdom.js
index 9940597..6a7057a 100644
--- a/tasks/lib/test-jsdom.js
+++ b/tasks/lib/test-jsdom.js
@@ -27,7 +27,7 @@ var testLibName      = path.join(__dirname, '..', '..', 'pkg', 'cordova.test.js'
 var testLib          = fs.readFileSync(testLibName, 'utf8')
 
 var jsdom    = require("jsdom-nogyp").jsdom;
-var document = jsdom(null, null, { url: 'http://jsdomtest.info/a?b#c' });
+var document = jsdom(null, null, { url: 'file:///jsdomtest.info/a?b#c' });
 var window   = document.createWindow();
 
 module.exports = function(callback) {

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/4d1c898e/test/test.urlutil.js
----------------------------------------------------------------------
diff --git a/test/test.urlutil.js b/test/test.urlutil.js
index c4f9acb..a3142d0 100644
--- a/test/test.urlutil.js
+++ b/test/test.urlutil.js
@@ -21,6 +21,10 @@
 
 describe('urlutil', function () {
     var urlutil = require('cordova/urlutil');
+    if (typeof process != 'undefined') {
+        // Tests don't work under jsdom.
+        return;
+    }
 
     it('can handle absolute URLs', function () {
         expect(urlutil.makeAbsolute('http://www.foo.com')).toBe('http://www.foo.com/');


Mime
View raw message