jeudi 16 avril 2015

Strip sensitive data from nock's "back" function before saving to disk

We are using nock's back function to store and later replay external HTTP requests in our tests. We commit the stored fixtures to our git source so that our tests can be run in environments where they don't need to make network requests.


Unfortunately, some of those HTTP requests contain sensitive data in the query string that we would rather not commit to source code.


Nock does not store request headers, but it does store the URI of the request, which makes it tricky.


Is there a way to remove certain parameters from the nock request path, and have nock match a request even though some parameters are missing from the stored path?


Aucun commentaire:

Enregistrer un commentaire