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
 | 
			
		||||
    // the browser would pass along cookie information. But recent
 | 
			
		||||
    // node defines WebSocket, so we narrow down this path to when
 | 
			
		||||
    // window is defined.
 | 
			
		||||
    if (typeof window !== 'undefined') {
 | 
			
		||||
    // a global document is defined (window doesn't work because
 | 
			
		||||
    // some tests mock it).
 | 
			
		||||
    if (typeof document !== 'undefined') {
 | 
			
		||||
      this._wsSocket = new WebSocket(this._url);
 | 
			
		||||
    } else {
 | 
			
		||||
      this._wsSocket = new WS(this._url, undefined, this._options);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user