Reset state before each Cypress test - TypeError: cy.resetDb is not a function
I use Cypress with my local web app. I followed install and run instructions:
Tests work fine until I wanted to reset database state according to the instructions:
I always get same error:
TypeError: cy.resetDb is not a function
Any reccomendations how to fix that?
You can use the
beforeEachfunction to execute actions before every single test.
The Cypress documentation gives an example of how you can use
beforeEach, but it expects you to implement the
resetDbfunction. This is not a generic function supplied by Cypress.
Either remove the call to
resetDbor implement it as a Cypress Custom Command.