@@ -38,6 +38,15 @@ describe('generateIncludes', () => {
38
38
expect ( anymatch ( includes , '../../node_modules/something-else/test.js' ) ) . toBe ( false ) ;
39
39
expect ( anymatch ( includes , 'node_modules/and-yet-another/test.js' ) ) . toBe ( false ) ;
40
40
} ) ;
41
+
42
+ test ( 'should handle win32 path delimiters well' , ( ) => {
43
+ const module = '@scoped/something' ;
44
+ const anotherModule = '@scoped\\something' ;
45
+
46
+ expect ( anymatch ( includes , `C:\\test\\node_modules\\${ module } \\sub\\test.js` ) ) . toBe ( true ) ;
47
+ expect ( anymatch ( includes , `C:\\test\\node_modules\\${ anotherModule } \\sub\\test.js` ) ) . toBe ( true ) ;
48
+ expect ( anymatch ( includes , `C:\\test\\node_modules\\unused\\sub\\test.js` ) ) . toBe ( false ) ;
49
+ } ) ;
41
50
} ) ;
42
51
43
52
describe ( 'generateExcludes' , ( ) => {
@@ -67,6 +76,15 @@ describe('generateExcludes', () => {
67
76
expect ( anymatch ( excludes , '../../node_modules/something-else' ) ) . toBe ( true ) ;
68
77
expect ( anymatch ( excludes , 'node_modules/and-yet-another' ) ) . toBe ( true ) ;
69
78
} ) ;
79
+
80
+ test ( 'should handle win32 path delimiters well' , ( ) => {
81
+ const module = '@scoped/something' ;
82
+ const anotherModule = '@scoped\\something' ;
83
+
84
+ expect ( anymatch ( excludes , `C:\\test\\node_modules\\${ module } \\sub\\test.js` ) ) . toBe ( false ) ;
85
+ expect ( anymatch ( excludes , `C:\\test\\node_modules\\${ anotherModule } \\sub\\test.js` ) ) . toBe ( false ) ;
86
+ expect ( anymatch ( excludes , `C:\\test\\node_modules\\unused\\sub\\test.js` ) ) . toBe ( true ) ;
87
+ } ) ;
70
88
} ) ;
71
89
72
90
describe ( 'regexEqual' , ( ) => {
0 commit comments