How to register rateLimiter component in convex-test?
Haven't been able to find anything on testing docs or component specific docs for testing these components. I'm aware that they must be registered by calling
t.registerComponent()
, with a string name(rateLimiter), schema(can't figure how to get this from the@convex-dev/rate-limiter
package), and modules(no idea either). Any guidance would be appreciated 🙂3 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
yeah sorry i forgot to add examples to the README. it's not very clean, but should work if you follow examples. probably the best example is the "migrations" component registration in this test:
https://github.com/get-convex/aggregate/blob/e956059b02f2be2ad4eb670e711dc801d8b47f0e/example/convex/aggregate.test.ts#L25
GitHub
aggregate/example/convex/aggregate.test.ts at e956059b02f2be2ad4eb6...
Component for aggregating counts and sums of Convex documents - get-convex/aggregate
Thank you! I was able to figure it out with this