@@ -92,6 +92,10 @@ it('should work with glob', async () => {
9292 expect ( globToRegex ( 'http://localhost:3000/signin-oidc*' ) . test ( 'http://localhost:3000/signin-oidc/foo' ) ) . toBeFalsy ( ) ;
9393 expect ( globToRegex ( 'http://localhost:3000/signin-oidc*' ) . test ( 'http://localhost:3000/signin-oidcnice' ) ) . toBeTruthy ( ) ;
9494
95+ expect ( globToRegex ( '**/*.js' ) . test ( '/foo.js' ) ) . toBeTruthy ( ) ;
96+ expect ( globToRegex ( 'asd/**.js' ) . test ( '/foo.js' ) ) . toBeFalsy ( ) ;
97+ expect ( globToRegex ( '**/*.js' ) . test ( 'bar_foo.js' ) ) . toBeFalsy ( ) ;
98+
9599 // range [] is NOT supported
96100 expect ( globToRegex ( '**/api/v[0-9]' ) . test ( 'http://example.com/api/v[0-9]' ) ) . toBeTruthy ( ) ;
97101 expect ( globToRegex ( '**/api/v[0-9]' ) . test ( 'http://example.com/api/version' ) ) . toBeFalsy ( ) ;
@@ -146,6 +150,10 @@ it('should work with glob', async () => {
146150 expect ( urlMatches ( 'http://first.host/' , 'http://second.host/foo' , '**/foo' ) ) . toBeTruthy ( ) ;
147151 expect ( urlMatches ( 'http://playwright.dev/' , 'http://localhost/' , '*//localhost/' ) ) . toBeTruthy ( ) ;
148152
153+ // /**/ should match /.
154+ expect ( urlMatches ( undefined , 'https://foo/bar.js' , 'https://foo/**/bar.js' ) ) . toBeTruthy ( ) ;
155+ expect ( urlMatches ( undefined , 'https://foo/bar.js' , 'https://foo/**/**/bar.js' ) ) . toBeTruthy ( ) ;
156+
149157 const customPrefixes = [ 'about' , 'data' , 'chrome' , 'edge' , 'file' ] ;
150158 for ( const prefix of customPrefixes ) {
151159 expect ( urlMatches ( 'http://playwright.dev/' , `${ prefix } :blank` , `${ prefix } :blank` ) ) . toBeTruthy ( ) ;
0 commit comments