|
1 | 1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html |
2 | 2 |
|
| 3 | +exports[`const values 1`] = ` |
| 4 | +"export type StringConst = "hello"; |
| 5 | +export type NumberConst = 42; |
| 6 | +export type BooleanConst = true; |
| 7 | +export type NullConst = null; |
| 8 | +" |
| 9 | +`; |
| 10 | + |
| 11 | +exports[`const values 2`] = ` |
| 12 | +"import * as v from "valibot"; |
| 13 | +
|
| 14 | +export const stringConstSchema = v.literal("hello"); |
| 15 | +export const numberConstSchema = v.literal(42); |
| 16 | +export const booleanConstSchema = v.literal(true); |
| 17 | +export const nullConstSchema = v.null(); |
| 18 | +" |
| 19 | +`; |
| 20 | + |
3 | 21 | exports[`nullables 1`] = ` |
4 | 22 | "export type MySchemaLolOrNullable = "lol" | "kek" | null; |
5 | 23 | " |
6 | 24 | `; |
| 25 | + |
| 26 | +exports[`top-level type array with null 1`] = ` |
| 27 | +"export type NullableString = string | null; |
| 28 | +export type NullableStringEnum = "active" | "inactive" | null; |
| 29 | +export type NullableInteger = number | null; |
| 30 | +export type MultiType = string | number; |
| 31 | +" |
| 32 | +`; |
| 33 | + |
| 34 | +exports[`top-level type array with null 2`] = ` |
| 35 | +"import * as v from "valibot"; |
| 36 | +
|
| 37 | +export const nullableStringSchema = v.nullable(v.string()); |
| 38 | +export const nullableStringEnumSchema = v.nullable(v.picklist(["active", "inactive"])); |
| 39 | +export const nullableIntegerSchema = v.nullable(v.pipe(v.number(), v.integer())); |
| 40 | +export const multiTypeSchema = v.union([v.string(), v.number()]); |
| 41 | +" |
| 42 | +`; |
| 43 | + |
| 44 | +exports[`top-level type array with null 3`] = ` |
| 45 | +"export const nullableStringEnum = ["active", "inactive"] as const; |
| 46 | +" |
| 47 | +`; |
0 commit comments