Convex test does not validate schemas
This is a problem I've been having for a while now, and It's probably time to fix it.
this code runs perfectly fine:
with the following schema:
Any Ideas on exactly why this is happening?
6 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Can you share more of what the mutation that should be hitting the error + the full definition of the Users table looks like?
From this test, I'd expect schema validation to generally work, so I'm wondering what specifically might be different in your case
GitHub
convex-test/convex/schemaValidation.test.ts at 7bc871107d30067fb131...
Testing harness for pure-JS Convex tests. Contribute to get-convex/convex-test development by creating an account on GitHub.
this is as simple as it gets but still fails
I have an inkling this is union related
just added union schema test to convex-test and they pass, same setup
odd
Hmm I cannot reproduce this (copied your exact schema minus the branded strings + exact mutation into the convex-test repo).
Mind sharing the version of convex-test + convex you're using?
Also just to double check the obvious thing -- you don't have
schemaValidation: true
set in your schema + the name of the table in the defineSchema
call is "users"
and not something else?sorry for not replying, updating and some cleaning up did the trick
Glad that seems to have fixed it!