Skip to content

Commit c172604

Browse files
committed
Added future test for Valibot's brand
1 parent 0e5b595 commit c172604

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/tests/superValidate.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,21 @@ describe('Valibot', () => {
262262
expect(() => valibot(schema)).not.toThrow();
263263
});
264264

265+
/*
266+
it('should work with FormPathLeaves and brand', async () => {
267+
const schema = v.object({ id: v.brand(v.string(), 'Id') });
268+
type T = Infer<typeof schema>;
269+
type IdSchema = { id: string & v.Brand<"Id"> };
270+
// ^? { id: string & Brand<"Id"> }
271+
272+
const a: FormPathLeaves<T> = 'id';
273+
// @ts-expect-error Should handle brand
274+
const b: FormPathLeaves<T> = 'id.length';
275+
a;
276+
b;
277+
});
278+
*/
279+
265280
/* it('should have the correct Input and Output types', () => {
266281
const logSchema = v.object({
267282
id: v.nullish(v.string(), ''),

0 commit comments

Comments
 (0)