[Pkg-javascript-commits] [sockjs-client] 52/434: Improved error reporting in tests.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:01 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 1814a6fd0a7af66cd26cb72d6b281b4e5c85c53d
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Wed Aug 3 19:01:23 2011 +0100

    Improved error reporting in tests.
---
 tests-src/test-factory.coffee | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests-src/test-factory.coffee b/tests-src/test-factory.coffee
index bb6b4d9..70d69ec 100644
--- a/tests-src/test-factory.coffee
+++ b/tests-src/test-factory.coffee
@@ -1,14 +1,14 @@
 echo_factory_factory = (protocol, messages) ->
     return ->
-        expect(3 + messages.length)
+        expect(2 + messages.length)
         a = messages.slice(0)
         r = new SockJS(sockjs_url + '/echo', [protocol])
-        ok(r)
         r.onopen = (e) ->
-            log('onopen', e)
+            log('onopen' + e)
             ok(true)
             r.send(a[0])
         r.onmessage = (e) ->
+            #log('onmessage');
             deepEqual(e.data, a[0])
             a.shift()
             if typeof a[0] is 'undefined'
@@ -16,8 +16,11 @@ echo_factory_factory = (protocol, messages) ->
             else
                 r.send(a[0])
         r.onclose = (e) ->
-            log('onclose', ''+e)
-            ok(true)
+            if a.length
+                ok(false, "Transport closed prematurely.")
+            else
+                log('onclose' + e)
+                ok(true)
             start()
 
 factor_echo_basic = (protocol) ->

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