In cypress migration guide they mention that plugin files are no longer supported. They also mention that you need to use >=v3.10 of code-coverage plugin
I do have correct version installed, and I tried to update cypress.config.ts to:
import { defineConfig } from "cypress";
export default defineConfig({
video: false,
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
require('@cypress/code-coverage/task')(on, config)
return config
},
},
});
but it doesn't work. What's the correct way? I believe I do have instrumenting working (I'm using @cypress/instrument-cra and see coverage object) but I don't see generated coverage files and I don't see a reset coverege step in tests
From your description the only step missing is the support file import.
I also have a
.babelrcwith the following, but I believe you can do without it if just covering e2e tests.Let me know if that's not it, I will give you step-by-step.