Repository navigation
fix(test): register action-retrier at the nested component path - #85
mayuriphad wants to merge 3 commits into
Conversation
The component installs action-retrier as a child, so an app that uses r2
resolves it at "<name>/actionRetrier". register() in the test helper
registered it at the top-level "actionRetrier", so deleteObject and store
threw `Component "r2/actionRetrier" is not registered` in tests that follow
the documented r2Test.register(t) pattern.
Register it under `${name}/actionRetrier` and add a test for the default and
a custom component name.
Fixes convex#72
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
c3b2b49 to
1361dba
Compare
…ion-retrier-path # Conflicts: # src/test.ts
…ion-retrier-path Signed-off-by: mayuriphad <mayuriphad656@gmail.com> # Conflicts: # src/test.ts
Fixes #72
Problem
@convex-dev/r2/test'sregister(t)registers action-retrier withactionRetrier.register(t), which uses the default top-level name"actionRetrier". The component installs action-retrier as a child (component.use(actionRetrier)inconvex.config.ts), so at runtimedeleteObject/storelook it up at"r2/actionRetrier". In a consumer test that follows the documentedr2Test.register(t)pattern this throws:Change
src/test.ts: register action-retrier at`${name}/actionRetrier`, so it follows a custom component name too.src/test.test.ts: checks thatregisterregistersr2andr2/actionRetrier(and<name>/actionRetrierfor a custom name), and never the top-levelactionRetrier.Testing
npx vitest run src/test.test.tspasses with the change and fails on both cases without it.tsc --noEmit,eslintandprettier --checkare clean on the changed files.