[Pkg-javascript-commits] [sockjs-client] 309/434: Cosmetic: Moving tests around

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:21 UTC 2014


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

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

commit d2f21f7f4296c3c9edaafe59e5df5e04d9dd6f9f
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Mon Jan 16 11:53:47 2012 +0000

    Cosmetic: Moving tests around
---
 tests/html/src/endtoendtests.coffee | 13 +++++++++++++
 tests/html/src/tests.coffee         | 39 -------------------------------------
 tests/html/src/unittests.coffee     | 22 +++++++++++++++++++++
 3 files changed, 35 insertions(+), 39 deletions(-)

diff --git a/tests/html/src/endtoendtests.coffee b/tests/html/src/endtoendtests.coffee
index cadc697..84cdd52 100644
--- a/tests/html/src/endtoendtests.coffee
+++ b/tests/html/src/endtoendtests.coffee
@@ -86,3 +86,16 @@ asyncTest "invalid url port", ->
             equals(e.reason, 'All transports failed')
         equals(e.wasClean, false)
         start()
+
+asyncTest "disabled websocket test", ->
+        expect(3)
+        r = newSockJS('/disabled_websocket_echo', 'websocket')
+        r.onopen = (e) ->
+            fail(true)
+        r.onmessage = (e) ->
+            fail(true)
+        r.onclose = (e) ->
+            equals(e.code, 2000)
+            equals(e.reason, "All transports failed")
+            equals(e.wasClean, false)
+            start()
diff --git a/tests/html/src/tests.coffee b/tests/html/src/tests.coffee
index 331c720..75dafdd 100644
--- a/tests/html/src/tests.coffee
+++ b/tests/html/src/tests.coffee
@@ -307,42 +307,3 @@ test_protocol_messages = (protocol) ->
 for protocol in protocols
     test_protocol_messages(protocol)
 
-
-module('other')
-
-test "EventEmitter", ->
-    expect(4)
-    r = new SockJS('//blah/abc', [])
-    r.addEventListener 'message', -> ok(true)
-    r.onmessage = -> fail(true)
-    bluff = -> fail(true)
-    r.addEventListener 'message', bluff
-    r.removeEventListener 'message', bluff
-    r.addEventListener 'message', bluff
-    r.addEventListener 'message', -> ok(true)
-    r.onmessage = -> ok(true)
-    r.removeEventListener 'message', bluff
-    r.dispatchEvent({type:'message'})
-
-    # Adding the same eventlistener should be indempotent (sockjs-client #4).
-    single = -> ok(true)
-    r.addEventListener 'close', single
-    r.addEventListener 'close', single
-    r.dispatchEvent({type:'close'}) # 1 callback run
-    r.removeEventListener 'close', single
-    r.dispatchEvent({type:'close'}) # 0 runs
-
-
-asyncTest "disabled websocket test", ->
-        expect(3)
-        r = newSockJS('/disabled_websocket_echo', 'websocket')
-        r.onopen = (e) ->
-            fail(true)
-        r.onmessage = (e) ->
-            fail(true)
-        r.onclose = (e) ->
-            equals(e.code, 2000)
-            equals(e.reason, "All transports failed")
-            equals(e.wasClean, false)
-            start()
-
diff --git a/tests/html/src/unittests.coffee b/tests/html/src/unittests.coffee
index cab6ba7..c629c5a 100644
--- a/tests/html/src/unittests.coffee
+++ b/tests/html/src/unittests.coffee
@@ -145,3 +145,25 @@ test 'detectProtocols', ->
             ['xdr-streaming', 'xdr-polling'])
     deepEqual(u.detectProtocols(ie8_probed, null, {cookie_needed:true}),
             ['iframe-htmlfile', 'iframe-xhr-polling'])
+
+test "EventEmitter", ->
+    expect(4)
+    r = new SockJS('//blah/abc', [])
+    r.addEventListener 'message', -> ok(true)
+    r.onmessage = -> fail(true)
+    bluff = -> fail(true)
+    r.addEventListener 'message', bluff
+    r.removeEventListener 'message', bluff
+    r.addEventListener 'message', bluff
+    r.addEventListener 'message', -> ok(true)
+    r.onmessage = -> ok(true)
+    r.removeEventListener 'message', bluff
+    r.dispatchEvent({type:'message'})
+
+    # Adding the same eventlistener should be indempotent (sockjs-client #4).
+    single = -> ok(true)
+    r.addEventListener 'close', single
+    r.addEventListener 'close', single
+    r.dispatchEvent({type:'close'}) # 1 callback run
+    r.removeEventListener 'close', single
+    r.dispatchEvent({type:'close'}) # 0 runs

-- 
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