simonsmith / cypress-image-snapshot

Catch visual regressions in Cypress with jest-image-snapshot
MIT License
64 stars 15 forks source link

The 'task' event has not been registered in the setupNodeEvents method #56

Closed coljacarls closed 3 months ago

coljacarls commented 4 months ago

I was testing the plugin in both, a vue 4 (vite 4) JS and TS project with Cypress ^13.6.1 and I always get the same error. After setting everything up my tests still run smoothly until I insert my first line of cy.matchImageSnapshot();. Then I always get this error:

cy.task('Matching image snapshot') failed with the following error:

The 'task' event has not been registered in the setupNodeEvents method. You must register it before using cy.task()

Fix this in your setupNodeEvents method here:
[*points to cypress.config.js*]

What can I do?

My cypress.config.js looks like this:

//...
e2e: {
    setupNodeEvents(on) {
      addMatchImageSnapshotPlugin(on)
    },
  },
//...
simonsmith commented 4 months ago

Could you share the entire cypress.config.js?

simonsmith commented 3 months ago

No activity, closing