File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
packages/fetch-mock/src/__tests__/Matchers Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,18 @@ describe('url matching', () => {
3939 expect ( route . matcher ( { url : 'http://a.com/paths' } ) ) . toBe ( true ) ;
4040 } ) ;
4141
42+ it ( 'match host: keyword' , ( ) => {
43+ const route = new Route ( {
44+ url : 'host:a.b.com' ,
45+ response : 200 ,
46+ } ) ;
47+
48+ expect ( route . matcher ( { url : 'http://b.com/path' } ) ) . toBe ( false ) ;
49+ expect ( route . matcher ( { url : 'http://a.com/path' } ) ) . toBe ( false ) ;
50+ expect ( route . matcher ( { url : 'http://a.b.com/path' } ) ) . toBe ( true ) ;
51+ expect ( route . matcher ( { url : 'https://a.bcom/path' } ) ) . toBe ( true ) ;
52+ } ) ;
53+
4254 it ( 'match end: keyword' , ( ) => {
4355 const route = new Route ( { url : 'end:com/path' , response : 200 } ) ;
4456 expect ( route . matcher ( { url : 'http://a.com/paths' } ) ) . toBe ( false ) ;
You can’t perform that action at this time.
0 commit comments