@@ -3,7 +3,6 @@ import eslintPkg from 'eslint/package.json';
3
3
import semver from 'semver' ;
4
4
5
5
import resolve , { CASE_SENSITIVE_FS , fileExistsWithCaseSync } from 'eslint-module-utils/resolve' ;
6
- import ModuleCache from 'eslint-module-utils/ModuleCache' ;
7
6
8
7
import * as path from 'path' ;
9
8
import * as fs from 'fs' ;
@@ -319,7 +318,11 @@ describe('resolve', function () {
319
318
const caseDescribe = ( ! CASE_SENSITIVE_FS ? describe : describe . skip ) ;
320
319
caseDescribe ( 'case sensitivity' , function ( ) {
321
320
let file ;
322
- const testContext = utils . testContext ( { 'import/resolve' : { 'extensions' : [ '.jsx' ] } } ) ;
321
+ const testContext = utils . testContext ( {
322
+ 'import/resolve' : { 'extensions' : [ '.jsx' ] } ,
323
+ 'import/cache' : { lifetime : 0 } ,
324
+ } ) ;
325
+ const testSettings = testContext . settings ;
323
326
before ( 'resolve' , function ( ) {
324
327
file = resolve (
325
328
// Note the case difference 'MyUncoolComponent' vs 'MyUnCoolComponent'
@@ -329,14 +332,19 @@ describe('resolve', function () {
329
332
expect ( file , 'path to ./jsx/MyUncoolComponent' ) . to . exist ;
330
333
} ) ;
331
334
it ( 'detects case does not match FS' , function ( ) {
332
- expect ( fileExistsWithCaseSync ( file , ModuleCache . getSettings ( testContext ) ) )
335
+ expect ( fileExistsWithCaseSync ( file , testSettings ) )
333
336
. to . be . false ;
334
337
} ) ;
335
338
it ( 'detecting case does not include parent folder path (issue #720)' , function ( ) {
336
339
const f = path . join ( process . cwd ( ) . toUpperCase ( ) , './tests/files/jsx/MyUnCoolComponent.jsx' ) ;
337
- expect ( fileExistsWithCaseSync ( f , ModuleCache . getSettings ( testContext ) , true ) )
340
+ expect ( fileExistsWithCaseSync ( f , testSettings ) )
338
341
. to . be . true ;
339
342
} ) ;
343
+ it ( 'detecting case should include parent folder path' , function ( ) {
344
+ const f = path . join ( process . cwd ( ) . toUpperCase ( ) , './tests/files/jsx/MyUnCoolComponent.jsx' ) ;
345
+ expect ( fileExistsWithCaseSync ( f , testSettings , true ) )
346
+ . to . be . false ;
347
+ } ) ;
340
348
} ) ;
341
349
342
350
describe ( 'rename cache correctness' , function ( ) {
0 commit comments