// Polly's HTTP adapter uses nock [1] underneath, with currenctly monkey-patches the built-in `node:http` module. For this to work, it must be imported quite early, before many other parts of hafas-client.
// Importing the adapter itself has no side effects (or rather: immediately undoes nock's monkey-patching, to re-patch when it is actually getting used). We activate it (by passing it into Polly's core) below.
// Note: We *must* import tap up here, not just in the if(VCR_MODE) block below, because a) we can only use `require()` conditionally, not `import`; and b) requiring it below makes the teardown script behave differently.
// may be related: https://github.com/tapjs/tapjs/issues/1005
// If a request's recording is not found, pass-through to the server and record the response.
recordIfMissing:false,
// If false, Polly will throw when attempting to persist any failed requests. A request is considered to be a failed request when its response's status code is ≥ 400.
recordFailedRequests:true,
// Await any unresolved requests handled by the polly instance (via flush) when stop is called.
flushRequestsOnStop:true,
// The Polly mode. Can be one of the following:
// - replay: Replay responses from recordings.
// - record: Force Polly to record all requests. This will overwrite recordings that already exist.
// - passthrough: Passes all requests through directly to the server without recording or replaying.
// When disabled, requests that have not been captured by the running Polly instance will be removed from any previous recording. This ensures that a recording will only contain the requests that were made during the lifespan of the Polly instance. When enabled, new requests will be appended to the recording file.