Nanciee / cypress-autorecord

Simplify API mocking by auto-recording/stubbing HTTP interactions and automating the process of updating/deleting mocks.
223 stars 52 forks source link

interceptPattern doesn't work with regex #56

Closed ERuseckas closed 3 years ago

ERuseckas commented 3 years ago

Passing valid regex:

  1. interceptPattern: new RegExp(REGEX_STRING)
  2. interceptPattern: /REGEX_STRING/ results in interceptPattern becoming as {}

If I convert valid regexp into string, then it's value is used as glob, not regex.

I see here 2 possible options:

  1. parse interceptPattern value to figure out is it regex or not
  2. change plugin, so that user could pass plugin config without using Cypress config
Nanciee commented 3 years ago

resolved in v3.1.2!