fix(mock): invoke override.mock.properties functions in faker schema factories - #3585
Conversation
…factories Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughExported getMockWithoutFunc from MSW mocks, used it in generateFakerForSchemas to serialize override.mock.properties functions as IIFEs, and added Vitest tests asserting IIFE emission for overridden schema properties and default faker output for non-overridden properties. ChangesSchema faker function override serialization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@wadakatu FYI 🤏🏻 |
Summary
schemas: true) sooverride.mock.propertiesfunction values are serialized as IIFEs, matching operation response mocksgetMockWithoutFuncingenerateFakerForSchemasinstead of passing rawoverride.mockoptionsCloses #3584
Test plan
npx vitest run packages/mock— 242 tests passingpackages/mock/src/faker/index.test.tsverify overridden properties emit(() => ...)()and not raw() => ...arrow functionsSummary by CodeRabbit
Tests
Refactor