File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -44,22 +44,16 @@ const logTestingPlaygroundURL = (element = getDocument().body) => {
4444  ) 
4545} 
4646
47- const  initialValue : { 
48-   [ key  in  keyof  typeof  queries  |  'debug'  |  'logTestingPlaygroundURL' ] ?: Function 
49- }  =  { debug,  logTestingPlaygroundURL} 
47+ const  initialValue  =  { debug,  logTestingPlaygroundURL} 
5048
5149export  const  screen  = 
5250  typeof  document  !==  'undefined'  &&  document . body  // eslint-disable-line @typescript-eslint/no-unnecessary-condition 
5351    ? getQueriesForElement ( document . body ,  queries ,  initialValue ) 
54-     : typedKeysOf ( queries ) . reduce < typeof   initialValue > ( ( helpers ,  key )  =>  { 
55-         helpers [ key ]  =  ( )  =>  { 
52+     : Object . keys ( queries ) . reduce ( ( helpers ,  key )  =>  { 
53+         helpers [ key   as   keyof   typeof   initialValue ]  =  ( )  =>  { 
5654          throw  new  TypeError ( 
5755            'For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error' , 
5856          ) 
5957        } 
6058        return  helpers 
6159      } ,  initialValue ) 
62- 
63- function  typedKeysOf < O  extends  Object > ( o : O )  { 
64-   return  Object . keys ( o )  as  Array < keyof  O > 
65- } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments