Skip to content

Commit

Permalink
Fix tests in IE < 10 (WebSocket not supported)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Jan 3, 2016
1 parent 298250c commit 9c44967
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/transports/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var BrowserWebSocket = global.WebSocket || global.MozWebSocket;
* exposed by `ws` for Node environment.
*/

var WebSocket = BrowserWebSocket || require('ws');
var WebSocket = BrowserWebSocket || (typeof window !== 'undefined' ? null : require('ws'));

/**
* Module exports.
Expand Down
2 changes: 1 addition & 1 deletion test/support/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// support in browsers and in node.js
// some tests do not yet work in both
exports.browser = !!global.window;
exports.wsSupport = !!((global.window && (window.WebSocket || window.MozWebSocket)) || require('ws'));
exports.wsSupport = !!(!global.window || window.WebSocket || window.MozWebSocket);

var userAgent = global.navigator ? navigator.userAgent : '';
exports.isOldSimulator = ~userAgent.indexOf('iPhone OS 4') || ~userAgent.indexOf('iPhone OS 5');
Expand Down

0 comments on commit 9c44967

Please sign in to comment.