Skip to content
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

🧩 It is not possible to ignore mock functions used only in test files #877

Open
Stanislavussov opened this issue Dec 12, 2024 · 3 comments
Labels
discussion Discussion

Comments

@Stanislavussov
Copy link

Discuss anything related to Knip

When I added test files to ignore it, then some mocking functions used in tests are considered as unused. Is there way to work around it somehow?

Thanks

@Stanislavussov Stanislavussov added the discussion Discussion label Dec 12, 2024
@webpro
Copy link
Collaborator

webpro commented Dec 12, 2024

Did you read the following https://knip.dev/guides/configuring-project-files and the pages it links to?

Not sure exactly what you're after but sounds like you're looking for production mode.

@Stanislavussov
Copy link
Author

Yes, I forgot to mention I am in production mode.

@webpro
Copy link
Collaborator

webpro commented Dec 12, 2024

Are you using the !test/mock.ts! pattern in project to exclude such files in production mode?

FYI, if this isn't helping, I'm going to need an actual reproduction to say something useful, before we start ping-ponging your situation here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion
Projects
None yet
Development

No branches or pull requests

2 participants