mirror of
https://github.com/gristlabs/grist-core.git
synced 2025-06-13 20:53:59 +00:00
some tests mock window
This commit is contained in:
parent
cdd4571a77
commit
0c5efbf756
@ -75,8 +75,9 @@ export class GristClientSocket {
|
|||||||
// if so, secure in the fact that we were in the browser and
|
// if so, secure in the fact that we were in the browser and
|
||||||
// the browser would pass along cookie information. But recent
|
// the browser would pass along cookie information. But recent
|
||||||
// node defines WebSocket, so we narrow down this path to when
|
// node defines WebSocket, so we narrow down this path to when
|
||||||
// window is defined.
|
// a global document is defined (window doesn't work because
|
||||||
if (typeof window !== 'undefined') {
|
// some tests mock it).
|
||||||
|
if (typeof document !== 'undefined') {
|
||||||
this._wsSocket = new WebSocket(this._url);
|
this._wsSocket = new WebSocket(this._url);
|
||||||
} else {
|
} else {
|
||||||
this._wsSocket = new WS(this._url, undefined, this._options);
|
this._wsSocket = new WS(this._url, undefined, this._options);
|
||||||
|
Loading…
Reference in New Issue
Block a user