-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Cypress: JUnit reporter is incorrectly reported as unlisted dependency #798
Comments
Thanks for the report, @duncan-thacker!
Yeah that's where the "magic" happens. Any chance you'd be up for a pull request? |
Potentially - I would probably need some help though as
If I get time I'll give this a go. |
Looks like we can ignore the largest part of this file. |
Yeah, according to this page https://docs.cypress.io/guides/tooling/reporters we can also filter out |
Prerequisites
Reproduction url
https://codesandbox.io/p/sandbox/musing-gagarin-d4vvr9
Reproduction access
Description of the issue
In a Cypress config, setting
"reporter": "junit"
causes knip to incorrectly reportjunit
as an unlisted dependency. Cypress bundles a junit reporter (see https://docs.cypress.io/guides/tooling/reporters) and does not depend on thejunit
package (I verified this by installing Cypress and then doingnpm ls junit
). The Junit functionality appears to be somewhere inside the Cypress package.Here is the report knip produces:
Looking at the plugin code for cypress, it appears to assume all listed reporters are package names, even though this isn't correct (not sure I've read this correctly!)
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/cypress/helpers.ts
Workarounds
I can install the
junit
package but that seems wasteful. I could also switch to another Junit reporter (e.g.mocha-junit-reporter
) but that also seems pointless.The text was updated successfully, but these errors were encountered: