-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Proposal for an Option to Enable Infinite Reuse of Mocks #11556
Comments
Hey @2012160085 👋
In fact, we have a test case for this to prove this works. Does this address what you're looking for? Edit: Adding that |
Thanks for fast response. I didnt think of Number.POSITIVE_INFINITY. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
You're welcome! Glad that works for you! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I think it would be great to add a clear option for continuous reuse of mocks
I saw that the maxUsageCount option was added for mock reuse in #11178.
I've been using mockLink with MockedResponses defined with a reasonably large number for maxUsageCount for development mock APIs, but I would love to see an option added for infinite reuse.
I read the comment in #9738 about the introduction of a new testing method using schemaLink. However, I think it would be great to add a clear option for continuous reuse of mocks in the existing MockedProvider method before that.
For example, while maintaining the current behavior when no maxUsageCount is provided, we could change the type of maxUsageCount to number | 'infinite' to allow specifying infinite explicitly for infinite reuse of mocks.
Would this approach be acceptable?
The text was updated successfully, but these errors were encountered: