11import path from "path" ;
22
3- import { glob } from "glob" ;
3+ import glob from "glob" ;
44
55import util from "util" ;
66
@@ -26,7 +26,7 @@ export async function getStepDefinitionPaths(
2626 return (
2727 await Promise . all (
2828 stepDefinitionPatterns . map ( ( pattern ) =>
29- glob ( pattern , { nodir : true , windowsPathsNoEscape : true } )
29+ glob . glob ( pattern , { nodir : true , windowsPathsNoEscape : true } )
3030 )
3131 )
3232 ) . reduce ( ( acum , el ) => acum . concat ( el ) , [ ] ) ;
@@ -82,11 +82,14 @@ export function getStepDefinitionPatternsPost10(
8282 throw new Error ( `${ filepath } is not inside ${ projectRoot } ` ) ;
8383 }
8484
85- const filepathReplacement = trimFeatureExtension (
86- path . relative (
87- configuration . preprocessor . implicitIntegrationFolder ,
88- filepath
89- )
85+ const filepathReplacement = glob . escape (
86+ trimFeatureExtension (
87+ path . relative (
88+ configuration . preprocessor . implicitIntegrationFolder ,
89+ filepath
90+ )
91+ ) ,
92+ { windowsPathsNoEscape : true }
9093 ) ;
9194
9295 debug ( `replacing [filepath] with ${ util . inspect ( filepathReplacement ) } ` ) ;
@@ -138,8 +141,9 @@ export function getStepDefinitionPatternsPre10(
138141 throw new Error ( `${ filepath } is not inside ${ fullIntegrationFolder } ` ) ;
139142 }
140143
141- const filepathReplacement = trimFeatureExtension (
142- path . relative ( fullIntegrationFolder , filepath )
144+ const filepathReplacement = glob . escape (
145+ trimFeatureExtension ( path . relative ( fullIntegrationFolder , filepath ) ) ,
146+ { windowsPathsNoEscape : true }
143147 ) ;
144148
145149 debug ( `replacing [filepath] with ${ util . inspect ( filepathReplacement ) } ` ) ;
0 commit comments