Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pollyRequest.shouldPassthrough ||
interceptor.shouldPassthrough
) {
return this.passthrough(pollyRequest);
}
this.assert(
'A persister must be configured in order to record and replay requests.',
!!this.persister
);
if (mode === MODES.RECORD) {
return this.record(pollyRequest);
}
if (mode === MODES.REPLAY) {
return this.replay(pollyRequest);
}
// This should never be reached. If it did, then something screwy happened.
this.assert(
'Unhandled request: \n' + stringifyRequest(pollyRequest, null, 2)
);
}
import { MODES, EXPIRY_STRATEGIES } from '@pollyjs/utils';
import Timing from '../utils/timing';
export default {
mode: MODES.REPLAY,
adapters: [],
adapterOptions: {},
persister: null,
persisterOptions: {
keepUnusedRequests: false
},
logging: false,
recordIfMissing: true,
recordFailedRequests: false,
expiresIn: null,
expiryStrategy: EXPIRY_STRATEGIES.WARN,
replay() {
this.mode = MODES.REPLAY;
}