How to use the @pollyjs/utils.MODES.REPLAY function in @pollyjs/utils

To help you get started, we’ve selected a few @pollyjs/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Netflix / pollyjs / packages / @pollyjs / adapter / src / index.js View on Github external
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)
    );
  }
github Netflix / pollyjs / packages / @pollyjs / core / src / defaults / config.js View on Github external
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,