Skip to content

Commit

Permalink
Test for #61
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Apr 24, 2012
1 parent 45b116a commit c22bed0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions tests/html/src/endtoendtests.coffee
Expand Up @@ -118,3 +118,17 @@ asyncTest "close on close", ->


u.delay 10, -> u.delay 10, ->
start() 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()
3 changes: 2 additions & 1 deletion tests/html/src/tests.coffee
Expand Up @@ -11,7 +11,8 @@ protocols = ['websocket',
newSockJS = (path, protocol) -> newSockJS = (path, protocol) ->
url = if /^http/.test(path) then path else client_opts.url + path url = if /^http/.test(path) then path else client_opts.url + path
options = jQuery.extend({}, client_opts.sockjs_opts) options = jQuery.extend({}, client_opts.sockjs_opts)
options.protocols_whitelist = [protocol] if protocol
options.protocols_whitelist = [protocol]
return new SockJS(url, null, options) return new SockJS(url, null, options)


echo_factory_factory = (protocol, messages) -> echo_factory_factory = (protocol, messages) ->
Expand Down

0 comments on commit c22bed0

Please sign in to comment.