This commit is contained in:
12
src/tests.ts
12
src/tests.ts
@@ -2,7 +2,11 @@ import { z } from "zod"
|
||||
import { ZodSchemaClassOf, defineDefaultValues } from "."
|
||||
|
||||
|
||||
class Test extends ZodSchemaClassOf(Object, {
|
||||
class Root {
|
||||
}
|
||||
|
||||
|
||||
class Test extends ZodSchemaClassOf(Root, {
|
||||
schema: z.object({
|
||||
id: z.bigint(),
|
||||
name: z.string(),
|
||||
@@ -11,11 +15,11 @@ class Test extends ZodSchemaClassOf(Object, {
|
||||
defaultValues: defineDefaultValues({ id: -1n }),
|
||||
}) {}
|
||||
Test.defaultValues
|
||||
const inst = await Test.newPromise({ id: 1n, name: "" })
|
||||
const inst = await Test.instantiatePromise({ id: 1n, name: "" })
|
||||
// Test.extend()
|
||||
|
||||
console.log(inst)
|
||||
|
||||
// class ChildTest extends Test {}
|
||||
class ChildTest extends Test {}
|
||||
|
||||
// ChildTest.newPromise()
|
||||
ChildTest.instantiate({ name: "" })
|
||||
|
||||
Reference in New Issue
Block a user