fix: replace .default with .prefault#5776
Conversation
|
@alanskovrlj is attempting to deploy a commit to the colinhacks Team on Vercel. A member of the Team first needs to authorize it. |
|
@pullfrog review |
There was a problem hiding this comment.
Reviewed — no issues found.
The change is correct: the test is named "object schema with prefault should return shallow clone" and lives in prefault.test.ts, so it should be calling .prefault() rather than .default(). The shallow clone behavior being tested (result1 !== result2 && deepEqual(result1, result2)) works identically for both methods (the cloning happens in the defaultValue getter shared by both), but .prefault() is the right one to exercise here. There's already an equivalent .default() test in default.test.ts:315.
Task list (3/3 completed)
- Checkout PR and read diff
- Investigate the claimed bug — verify whether .default() vs .prefault() is correct in the test
- Submit review
Claude Opus | 𝕏
|
Good catch — the test in Note: this comment was produced by an AI coding assistant. |
|
Landed in Zod 4.4 |
The test intended to verify the behavior of
.prefault(), but it was using.default()instead.This PR updates the test to use
.prefault()so it correctly tests the intended functionality.