pollyjs icon indicating copy to clipboard operation
pollyjs copied to clipboard

Feature: A CLI to regenerate request ids

Open ludbek opened this issue 4 years ago • 0 comments

Recently we updated axios version. This makes changes to the value of User-Agent header. As a side effect, when we ran our tests pollyjs would invalidate existing records and make fresh requests. The APIs are from third parties (Although now its feels like we should have mocked those APIs with hard coded responses.).

We added following configuration to our existing configuration. But above problem still persists.

polly.configure({
  matchRequestsBy: {
    headers: {
      exclude: ['User-Agent']
    }
  }
});

It would be helpful to have a CLI command that would regenerate fresh request ids without making actual api calls. For this we might even need to have pollyconfig.json file to put some default configs.

ludbek avatar Feb 25 '20 03:02 ludbek