While developing an app with mocks, sometimes We need to
passthrough a certain
url, so pretender can pass the request to the specified
url, so what We’d do is simply
server.passthrough("https://domain.com/pass_here") or server.passthrough("https://domain.com/**")
to pass all requests to this domain.
But what if We deal with aws lambdas which can have generated urls like here
Up until recently, We couldn’t handle that, at least not so easily, but luckily an
undocumented feature was added which allows for passthrough to take a function as argument which has to return either
true to passthrough the request or
false to be caught by pretender.
(function argument is allowed in
server.passthrough((request) => request.url.includes("domain")
Should handle pesky auto-generated urls.