@@ -42,7 +42,8 @@ describe('parallel option', () => {
4242
4343 describe ( 'basic functionality' , ( ) => {
4444 it ( 'parallel: false returns correct results (default)' , ( ) => {
45- const results = globSync ( '**/*.ts' , { cwd : fixture , parallel : false } )
45+ // Use posix: true for predictable forward slashes in test assertions
46+ const results = globSync ( '**/*.ts' , { cwd : fixture , parallel : false , posix : true } )
4647
4748 expect ( results ) . toContain ( 'src/index.ts' )
4849 expect ( results ) . toContain ( 'src/util.ts' )
@@ -54,7 +55,8 @@ describe('parallel option', () => {
5455 } )
5556
5657 it ( 'parallel: true returns correct results' , ( ) => {
57- const results = globSync ( '**/*.ts' , { cwd : fixture , parallel : true } )
58+ // Use posix: true for predictable forward slashes in test assertions
59+ const results = globSync ( '**/*.ts' , { cwd : fixture , parallel : true , posix : true } )
5860
5961 expect ( results ) . toContain ( 'src/index.ts' )
6062 expect ( results ) . toContain ( 'src/util.ts' )
@@ -114,11 +116,12 @@ describe('parallel option', () => {
114116 } )
115117
116118 it ( 'parallel works with maxDepth' , ( ) => {
119+ // Use posix: true for predictable path separators
117120 const serialResults = new Set (
118- globSync ( '**/*' , { cwd : fixture , parallel : false , maxDepth : 2 } )
121+ globSync ( '**/*' , { cwd : fixture , parallel : false , maxDepth : 2 , posix : true } )
119122 )
120123 const parallelResults = new Set (
121- globSync ( '**/*' , { cwd : fixture , parallel : true , maxDepth : 2 } )
124+ globSync ( '**/*' , { cwd : fixture , parallel : true , maxDepth : 2 , posix : true } )
122125 )
123126
124127 expect ( parallelResults ) . toEqual ( serialResults )
@@ -144,18 +147,21 @@ describe('parallel option', () => {
144147 } )
145148
146149 it ( 'parallel works with ignore patterns' , ( ) => {
150+ // Use posix: true for predictable path separators
147151 const serialResults = new Set (
148152 globSync ( '**/*' , {
149153 cwd : fixture ,
150154 parallel : false ,
151155 ignore : [ '**/node_modules/**' ] ,
156+ posix : true ,
152157 } )
153158 )
154159 const parallelResults = new Set (
155160 globSync ( '**/*' , {
156161 cwd : fixture ,
157162 parallel : true ,
158163 ignore : [ '**/node_modules/**' ] ,
164+ posix : true ,
159165 } )
160166 )
161167
@@ -165,9 +171,12 @@ describe('parallel option', () => {
165171 } )
166172
167173 it ( 'parallel works with mark: true' , ( ) => {
168- const serialResults = new Set ( globSync ( '**/*' , { cwd : fixture , parallel : false , mark : true } ) )
174+ // Use posix: true for predictable path separators
175+ const serialResults = new Set (
176+ globSync ( '**/*' , { cwd : fixture , parallel : false , mark : true , posix : true } )
177+ )
169178 const parallelResults = new Set (
170- globSync ( '**/*' , { cwd : fixture , parallel : true , mark : true } )
179+ globSync ( '**/*' , { cwd : fixture , parallel : true , mark : true , posix : true } )
171180 )
172181
173182 expect ( parallelResults ) . toEqual ( serialResults )
@@ -177,11 +186,12 @@ describe('parallel option', () => {
177186 } )
178187
179188 it ( 'parallel works with dotRelative: true' , ( ) => {
189+ // Use posix: true for predictable path separators
180190 const serialResults = new Set (
181- globSync ( '**/*.md' , { cwd : fixture , parallel : false , dotRelative : true } )
191+ globSync ( '**/*.md' , { cwd : fixture , parallel : false , dotRelative : true , posix : true } )
182192 )
183193 const parallelResults = new Set (
184- globSync ( '**/*.md' , { cwd : fixture , parallel : true , dotRelative : true } )
194+ globSync ( '**/*.md' , { cwd : fixture , parallel : true , dotRelative : true , posix : true } )
185195 )
186196
187197 expect ( parallelResults ) . toEqual ( serialResults )
@@ -194,7 +204,8 @@ describe('parallel option', () => {
194204
195205 describe ( 'Glob class with parallel' , ( ) => {
196206 it ( 'Glob class accepts parallel option' , ( ) => {
197- const g = new Glob ( '**/*.ts' , { cwd : fixture , parallel : true } )
207+ // Use posix: true for predictable path separators
208+ const g = new Glob ( '**/*.ts' , { cwd : fixture , parallel : true , posix : true } )
198209 const results = g . walkSync ( )
199210
200211 expect ( results ) . toContain ( 'src/index.ts' )
@@ -212,7 +223,8 @@ describe('parallel option', () => {
212223 } )
213224
214225 it ( 'Glob class async walk with parallel' , async ( ) => {
215- const g = new Glob ( '**/*.md' , { cwd : fixture , parallel : true } )
226+ // Use posix: true for predictable path separators
227+ const g = new Glob ( '**/*.md' , { cwd : fixture , parallel : true , posix : true } )
216228 const results = await g . walk ( )
217229
218230 expect ( results ) . toContain ( 'docs/readme.md' )
0 commit comments