@@ -262,12 +262,6 @@ function runResolverTests(resolver: 'node' | 'webpack') {
262
262
} )
263
263
264
264
if ( ! CASE_SENSITIVE_FS ) {
265
- const relativePath = './test/fixtures/jsx/MyUnCoolComponent.jsx'
266
- const cwd = process . cwd ( )
267
- const mismatchedPath = path
268
- . join ( cwd . toUpperCase ( ) , relativePath )
269
- . replaceAll ( '\\' , '/' )
270
-
271
265
ruleTester . run ( 'case sensitivity' , rule , {
272
266
valid : [
273
267
tValid ( {
@@ -296,31 +290,39 @@ function runResolverTests(resolver: 'node' | 'webpack') {
296
290
] ,
297
291
} )
298
292
299
- ruleTester . run ( 'case sensitivity strict' , rule , {
300
- valid : [
301
- // #1259 issue
302
- tValid ( {
303
- // caseSensitiveStrict is disabled by default
304
- code : `import foo from "${ mismatchedPath } "` ,
305
- } ) ,
306
- ] ,
293
+ // Windows plain absolute path is not supported by Node.js
294
+ // TODO: add `file:` protocol support
295
+ if ( process . platform !== 'win32' ) {
296
+ const relativePath = './test/fixtures/jsx/MyUnCoolComponent.jsx'
297
+ const cwd = process . cwd ( )
298
+ const mismatchedPath = path . join ( cwd . toUpperCase ( ) , relativePath )
299
+
300
+ ruleTester . run ( 'case sensitivity strict' , rule , {
301
+ valid : [
302
+ // #1259 issue
303
+ tValid ( {
304
+ // caseSensitiveStrict is disabled by default
305
+ code : `import foo from "${ mismatchedPath } "` ,
306
+ } ) ,
307
+ ] ,
307
308
308
- invalid : [
309
- // #1259 issue
310
- tInvalid ( {
311
- // test with enabled caseSensitiveStrict option
312
- code : `import foo from "${ mismatchedPath } "` ,
313
- options : [ { caseSensitiveStrict : true } ] ,
314
- errors : [ createError ( 'casingMismatch' , mismatchedPath ) ] ,
315
- } ) ,
316
- tInvalid ( {
317
- // test with enabled caseSensitiveStrict option and disabled caseSensitive
318
- code : `import foo from "${ mismatchedPath } "` ,
319
- options : [ { caseSensitiveStrict : true , caseSensitive : false } ] ,
320
- errors : [ createError ( 'casingMismatch' , mismatchedPath ) ] ,
321
- } ) ,
322
- ] ,
323
- } )
309
+ invalid : [
310
+ // #1259 issue
311
+ tInvalid ( {
312
+ // test with enabled caseSensitiveStrict option
313
+ code : `import foo from "${ mismatchedPath } "` ,
314
+ options : [ { caseSensitiveStrict : true } ] ,
315
+ errors : [ createError ( 'casingMismatch' , mismatchedPath ) ] ,
316
+ } ) ,
317
+ tInvalid ( {
318
+ // test with enabled caseSensitiveStrict option and disabled caseSensitive
319
+ code : `import foo from "${ mismatchedPath } "` ,
320
+ options : [ { caseSensitiveStrict : true , caseSensitive : false } ] ,
321
+ errors : [ createError ( 'casingMismatch' , mismatchedPath ) ] ,
322
+ } ) ,
323
+ ] ,
324
+ } )
325
+ }
324
326
}
325
327
}
326
328
0 commit comments