fix(tests): fix all failing tests #837
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
/\\.fromvitest.config.ts. This was necessary to fix the errorNo test files found. This can also be fixed by updating Vitest to version 4, but this has a change to how snapshots are stored. See the migration guide. All of the tests are found by removing/\\., so the Vitest upgrade is better in a later PR.zinvitest.config.tsto spy onparse()fromzod/v4/core. Without this, aTypeError: Cannot redefine property: parseerror occurs.bun testtobun run testin CONTRIBUTING.md.bun testruns Bun's native test runner, not thetestscript.Teststage to.github/workflows/main.yml. It was removed in this PR and the tests haven't been running in CI.Notes:
useFormoutside of a component. This fixed the errorsError: Invalid hook call. Hooks can only be called inside of the body of a function component.andTypeError: Cannot read properties of null (reading 'useRef').type: error.codetotype: ''(becauseerror.codeis not part of the standard schema). This required an update to the snapshot.{ coerce: true }must be passed in)superstructResolverthat improves handling of coerced schemas (This fixes a type error with the form values).watchto return the correct value for a coerced schema).forloop was looping through theschemaErrorsvariable, but the current error was based on thetypeschemaErrors[0]variable. This caused only the first error to be returned.typeschema.validateto watchingschema["~standard"]schema.parse()instead ofz4.parse()Fixes #832