Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test for #61

  • Loading branch information...
commit c22bed0afefa9547616ed096d71031264902d468 1 parent 45b116a
@majek majek authored
View
14 tests/html/src/endtoendtests.coffee
@@ -118,3 +118,17 @@ asyncTest "close on close", ->
u.delay 10, ->
start()
+
+# Test for #61
+asyncTest "EventEmitter exception handling", ->
+ expect(1)
+ r = newSockJS('/echo', 'xhr-streaming')
+ prev_onerror = window.onerror
+ window.onerror = (e) ->
+ ok(/onopen error/.test(''+e))
+ window.onerror = prev_onerror
+ r.close()
+ r.onopen = (e) ->
+ throw "onopen error"
+ r.onclose = ->
+ start()
View
3  tests/html/src/tests.coffee
@@ -11,7 +11,8 @@ protocols = ['websocket',
newSockJS = (path, protocol) ->
url = if /^http/.test(path) then path else client_opts.url + path
options = jQuery.extend({}, client_opts.sockjs_opts)
- options.protocols_whitelist = [protocol]
+ if protocol
+ options.protocols_whitelist = [protocol]
return new SockJS(url, null, options)
echo_factory_factory = (protocol, messages) ->
Please sign in to comment.
Something went wrong with that request. Please try again.