How to use the @pollyjs/utils.MODES.RECORD 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
}

    if (
      mode === MODES.PASSTHROUGH ||
      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)
    );
  }