Nanciee / cypress-autorecord

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

suggestion: scope each `it` block to it's own cypress `mocks` file #43

Closed ha404 closed 3 years ago

ha404 commented 3 years ago

I think it could make it easier to deal with modifying mocks scoped to the it block you want to modify, it could also potentially make it easier to do re-recordings if you just manually delete the mock you want re-recorded.

The only thing I'm concerned with is how do you name the mock file with something like this:

cypress/integration/settings/billing.spec.js:

it('will render something after 30 seconds after some button is clicked', ...)

^Generates a mock: mocks/settings/billing/will-render-something-after-30-seconds-after-some-button-is-clicked.spec.json

What do you think?

ha404 commented 3 years ago

Just kidding, I just saw this: https://github.com/Nanciee/cypress-autorecord/pull/29