-
|
I'm on orchid-orm v1.40.1 with associated downstream dependencies and trying to use the Test Factory for my unit tests. When using Test Factory, I'm getting the error: I have tried with both I am able to directly call db.test.create() just fine, but would love to use factory in some other test where any data will work and would appreciate any help in getting the test factory working. I have created a table that looks like: In my unit test I have: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
The error suggests that there is a suspicious |
Beta Was this translation helpful? Give feedback.
I see, so the test factory generates data based on column types: random number for
int, random text forvarchar, but it doesn't know how to generate data for yourt.idbecause it is a custom type.You can add
.as(t.string()),to the definition of the sharedidcolumn, and test factory would generate a random string.Another option: you can configure test factory for this specific table to generate data for
idas needed, here is a doc.This isn't ideal because it's per table, it would be better to define how to generate id just once for all tables, not implemented yet.