File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -340,8 +340,10 @@ describe('resolve', function () {
340340      expect ( fileExistsWithCaseSync ( f ,  testSettings ) ) 
341341        . to . be . true ; 
342342    } ) ; 
343-     it ( 'detecting case should include parent folder path' ,  function  ( )  { 
343+     it . only ( 'detecting case should include parent folder path' ,  function  ( )  { 
344344      const  f  =  path . join ( process . cwd ( ) . toUpperCase ( ) ,  './tests/files/jsx/MyUnCoolComponent.jsx' ) ; 
345+       console . log ( process . cwd ( ) ) ; 
346+       console . log ( f ) ; 
345347      expect ( fileExistsWithCaseSync ( f ,  testSettings ,  true ) ) 
346348        . to . be . false ; 
347349    } ) ; 
Original file line number Diff line number Diff line change @@ -55,21 +55,28 @@ function tryRequire(target, sourceFile) {
5555exports . fileExistsWithCaseSync  =  function  fileExistsWithCaseSync ( filepath ,  cacheSettings ,  strict )  { 
5656  // don't care if the FS is case-sensitive 
5757  if  ( CASE_SENSITIVE_FS )  return  true ; 
58- 
58+    console . log ( 'case insensitive' ) ; 
5959  // null means it resolved to a builtin 
6060  if  ( filepath  ===  null )  return  true ; 
6161  if  ( filepath . toLowerCase ( )  ===  process . cwd ( ) . toLowerCase ( )  &&  ! strict )  return  true ; 
6262  const  parsedPath  =  path . parse ( filepath ) ; 
63+   console . log ( 'parsedPath' ,  parsedPath ) ; 
6364  const  dir  =  parsedPath . dir ; 
6465
6566  let  result  =  fileExistsCache . get ( filepath ,  cacheSettings ) ; 
66-   if  ( result  !=  null )  return  result ; 
67+   if  ( result  !=  null )  { 
68+     console . log ( 'result' ,  result ) ; 
69+     return  result ; 
70+   } 
6771
6872  // base case 
6973  if  ( dir  ===  ''  ||  parsedPath . root  ===  filepath )  { 
74+     console . log ( 'dir' ,  dir ) ; 
75+     console . log ( 'parsedPath.root' ,  parsedPath . root ) ; 
7076    result  =  true ; 
7177  }  else  { 
7278    const  filenames  =  fs . readdirSync ( dir ) ; 
79+     console . log ( 'filenames:' ,  filenames ) ; 
7380    if  ( filenames . indexOf ( parsedPath . base )  ===  - 1 )  { 
7481      result  =  false ; 
7582    }  else  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments