jameslnewell / xhr-mock

Utility for mocking XMLHttpRequest.
196 stars 48 forks source link

Add url masks please #89

Closed a-x- closed 4 years ago

a-x- commented 4 years ago

As I understand xhr-mock doesn't support express.js-like masks o_O

e.g. /users/:id

a-x- commented 4 years ago

you can use path-to-regexp

jameslnewell commented 4 years ago

Thanks for the feature request! Its not released yet but this is supported in ^3.

https://github.com/jameslnewell/xhr-mock/blob/12ab29ba24e41dc24bbe9ac54861a9bc8e177376/packages/router/src/createMiddleware.test.ts#L81