Skip to content

Include registerCodeCoverageTasks ES6 example for cypress.config #6227

@manulera

Description

@manulera

Description

Hello! Thanks for the great tool and for the awesome documentation. Just wanted to suggest that you should document the alternative ES6 way to register the code coverage task

In your docs, you suggest using require('@cypress/code-coverage/task')(on, config). That used to work in vite 4, but newer versions of vite do not allow using require, and you need to use import syntax instead.

Took me a while to figure out that I could replace that by

import registerCodeCoverageTasks from '@cypress/code-coverage/task.js';

....

registerCodeCoverageTasks(on, config);

...

Found out thanks to this isssue: cypress-io/code-coverage#715

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions