fix(core-testing): address code review feedback for Task 1
- Remove unused @trpc/tanstack-react-query dependency - Document renderWithProviders tRPC provider omission (boundary constraint) - Implement deep merge in defineFactory (preserves nested sibling keys) - Document httpBatchLink<any> rationale in mock-trpc.ts - Align core-testing's own vitest.config with safety defaults (mockReset, unstubGlobals) - Add createMockTrpcClient usage example to AGENTS.md Reviewer: superpowers:code-reviewer (Task 1 of Plan 7). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,12 @@ export interface RenderOptions {
|
||||
queryClient?: QueryClient;
|
||||
}
|
||||
|
||||
// Wraps the given UI with QueryClientProvider only.
|
||||
// This helper intentionally omits a TRPCProvider. Adding one would require importing
|
||||
// AppRouter from @repo/core-api, which violates the tooling→core-composition boundary rule.
|
||||
// For components that need tRPC in the render tree, the consumer must:
|
||||
// 1. Wire their own TRPCProvider (from their app's tRPC client setup).
|
||||
// 2. Pass a client built with createMockTrpcClient as the tRPC client.
|
||||
export function renderWithProviders(
|
||||
ui: ReactElement,
|
||||
options: RenderOptions = {},
|
||||
|
||||
Reference in New Issue
Block a user