ava-playback icon indicating copy to clipboard operation
ava-playback copied to clipboard

Controlling which domains are recorded

Open djake opened this issue 4 years ago • 0 comments

I am using Ava to test an api (with supertest), and perform some configuration with docker (via dockerode). I don't want ava-playback to concern itself with the local loopback interface and/or my local docker server. Is it possible to specify (or exclude) certain hosts from record/playback?

nock does allow this, e.g.:

A common use case when testing local endpoints would be to disable all but localhost, then add in additional nocks for external requests:

nock.disableNetConnect() // Allow localhost connections so we can test local routes and mock servers. nock.enableNetConnect('127.0.0.1')

https://github.com/nock/nock#enabling-requests

djake avatar Jan 24 '21 21:01 djake