cypress-io / code-coverage

Saves the code coverage collected during Cypress tests
MIT License
430 stars 108 forks source link

Add support for SWC #583

Open lone-cloud opened 2 years ago

lone-cloud commented 2 years ago

SWC (https://github.com/swc-project/swc) is a more performant babel replacement that's being shipped with some frameworks like Next.js This library only appears to work strictly with babel and I was not yet able to figure out how to get it working with SWC's code instrumentation plugin: https://github.com/kwonoj/swc-coverage-instrument

MattyBalaam commented 2 years ago

This works for me:https://github.com/kwonoj/swc-plugin-coverage-instrument

arendjantetteroo commented 2 years ago

@MattyBalaam which steps did you take to set this up?

MattyBalaam commented 2 years ago

@arendjantetteroo I can't recall, but I think I just followed the readme

renatojf commented 1 year ago

Any updates on this topic? Trying to setup with the plugin, but it does not work :(

MattyBalaam commented 1 year ago

Thanks for the downvotes guys 😆

The readme was pretty straightforward I have to say, here’s a screenshot of our loader config but it‘s no different from the readme.

Screenshot 2023-03-14 at 13 28 41

Unfortunately, this has stopped working with @swc/core 1.3.39

Mistrain-y-y commented 1 year ago

Thanks for the downvotes guys 😆

The readme was pretty straightforward I have to say, here’s a screenshot of our loader config but it‘s no different from the readme.

Screenshot 2023-03-14 at 13 28 41

Unfortunately, this has stopped working with @swc/core 1.3.39

should i write in next.config.js?

MattyBalaam commented 1 year ago

Thanks for the downvotes guys 😆 The readme was pretty straightforward I have to say, here’s a screenshot of our loader config but it‘s no different from the readme.

Screenshot 2023-03-14 at 13 28 41

Unfortunately, this has stopped working with @swc/core 1.3.39

should i write in next.config.js?

I don't know about next config, we don't use it. This is a webpack config for compiling react components

jasonmit commented 11 months ago

Any traction on this? Not supporting Next out-of-the box seems like a miss for Cypress.io

JoelEkpenyong commented 3 months ago

Any notable progress on this? I am unable to generate coverage report for my cypress tests