[Pkg-javascript-commits] [sockjs-client] 228/350: better display of unsupported tests

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:04:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit c6b804ca0b778ceec841fcc457cbb6d2068b95a8
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Thu Oct 23 16:33:34 2014 -0400

    better display of unsupported tests
---
 tests/lib/echo-tests.js |  9 +++++----
 tests/lib/end-to-end.js | 51 +++++++++++++++++++++++++------------------------
 tests/lib/senders.js    |  2 +-
 tests/lib/transports.js |  2 +-
 4 files changed, 33 insertions(+), 31 deletions(-)

diff --git a/tests/lib/echo-tests.js b/tests/lib/echo-tests.js
index 500f503..952d761 100644
--- a/tests/lib/echo-tests.js
+++ b/tests/lib/echo-tests.js
@@ -93,11 +93,12 @@ module.exports.echoUtfEncoding = function echoUtfEncoding(url, transport) {
 };
 
 module.exports.echoFromChild = function echoFromChild(url, transport) {
+  if (!iframeUtils.iframeEnabled) {
+    it('echo from child [unsupported]');
+    return;
+  }
+
   it('echo from child', function (done) {
-    if (!iframeUtils.iframeEnabled) {
-      done();
-      return;
-    }
     this.timeout(10000);
 
     var title = this.runnable().fullTitle();
diff --git a/tests/lib/end-to-end.js b/tests/lib/end-to-end.js
index fc47941..0e7194a 100644
--- a/tests/lib/end-to-end.js
+++ b/tests/lib/end-to-end.js
@@ -26,32 +26,33 @@ describe('End to End', function () {
       };
     });
 
-    it('invalid url port', function (done) {
-      var badUrl;
-      if (global.location) {
-        badUrl = global.location.protocol + '//' + global.location.hostname + ':1079';
-      } else {
-        badUrl = 'http://localhost:1079';
-      }
-      // TODO this isn't a great way to disable this test
-      if (!XHRCors.enabled && !XDR.enabled && !InfoIframe.enabled()) {
-        // CORS unsupported, won't actually hit info server
-        done();
-        return;
-      }
+    // TODO this isn't a great way to disable this test
+    if (!XHRCors.enabled && !XDR.enabled && !InfoIframe.enabled()) {
+      // CORS unsupported, won't actually hit info server
+      it('invalid url port [unsupported]');
+      return;
+    } else {
+      it('invalid url port', function (done) {
+        var badUrl;
+        if (global.location) {
+          badUrl = global.location.protocol + '//' + global.location.hostname + ':1079';
+        } else {
+          badUrl = 'http://localhost:1079';
+        }
 
-      var sjs = testUtils.newSockJs(badUrl, 'jsonp-polling');
-      expect(sjs).to.be.ok();
-      sjs.onopen = sjs.onmessage = function () {
-        expect().fail('Open/Message event should not fire for an invalid port');
-      };
-      sjs.onclose = function (e) {
-        expect(e.code).to.equal(1002);
-        expect(e.reason).to.equal('Cannot connect to server');
-        expect(e.wasClean).to.equal(false);
-        done();
-      };
-    });
+        var sjs = testUtils.newSockJs(badUrl, 'jsonp-polling');
+        expect(sjs).to.be.ok();
+        sjs.onopen = sjs.onmessage = function () {
+          expect().fail('Open/Message event should not fire for an invalid port');
+        };
+        sjs.onclose = function (e) {
+          expect(e.code).to.equal(1002);
+          expect(e.reason).to.equal('Cannot connect to server');
+          expect(e.wasClean).to.equal(false);
+          done();
+        };
+      });
+    }
 
     it('disabled websocket test', function (done) {
       var sjs = testUtils.newSockJs('/disabled_websocket_echo', 'websocket');
diff --git a/tests/lib/senders.js b/tests/lib/senders.js
index f8a99ba..6a0fb40 100644
--- a/tests/lib/senders.js
+++ b/tests/lib/senders.js
@@ -77,7 +77,7 @@ describe('Senders', function () {
 
   describe('xdr', function () {
     if (!Xdr.enabled) {
-      it('[unsupported]', function() { expect(true).to.be.ok(); });
+      it('[unsupported]');
       return;
     }
     ajaxSimple(Xdr);
diff --git a/tests/lib/transports.js b/tests/lib/transports.js
index b3c01d9..4e393f7 100644
--- a/tests/lib/transports.js
+++ b/tests/lib/transports.js
@@ -35,7 +35,7 @@ describe('Transports', function () {
       });
 
       if (!Trans.enabled({ cookie_needed: false, nullOrigin: false, sameScheme: true, sameOrigin: true })) {
-        it('[unsupported]', function () { expect(true).to.be.ok(); });
+        it('[unsupported]');
         return;
       }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list