-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add a way to stub the dependency #27164
Comments
Hi @asekularaclf - in order to properly respond to your request we need more information. Stubbing and Spying in component tests can be done using the If your application is using a legacy module format like CommonJS and you are unable to use If your project is using ESM then these APIs are unable to work as expected due to by-design limitations in ESM. There has been a lot of conversation in this ticket which provides context and potential workarounds. If your application is using ESM and you're using Vite for bundling we have an experimental Vite plugin you can apply to try to work around some of the limitations of ESM. It is still in an alpha stage so it will likely require a few tweaks to get it working in your baseline but has been used successfully on several projects thus far. Please let me know which of these scenarios is applicable to you so we can handle this ticket accordingly. |
Needs more info - Cypress If you've got a specific example you can share, I can help make recommendations. Right now there isn't enough info to action, so I'll close this. Happy to reopen with additional info. |
What would you like?
It's a pain not to be able to mock/stub the dependency/node module when writing Cypress component tests.
Why is this needed?
Because a test software like Cypress should have a feature like this.
Other
No response
The text was updated successfully, but these errors were encountered: