I would like to know if it is possible to mock certain URLs using wildcards, e.g. all URLs that start with /auth
. Can I do something like /auth*
?
Yes, per the docs you can use a regex as the URL. One of their examples is similar to your use case:
Using variables in regex
const usersUri = '/users'; const url = new RegExp(`${usersUri}/*`); mock.onGet(url).reply(200, users);