Skip to content

Commit b503c0a

Browse files
committed
Add Vitest schemaMatching interoperability tests
1 parent 94c1cac commit b503c0a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

packages/common/test/Type.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3063,4 +3063,18 @@ describe("Standard Schema V1", () => {
30633063
number & Brand<"Int"> & Brand<"NonNegative"> & Brand<"Positive">
30643064
>();
30653065
});
3066+
3067+
test("Vitest schemaMatching interoperability", () => {
3068+
expect(1).toEqual(expect.schemaMatching(PositiveInt));
3069+
3070+
const user = {
3071+
name: "Alice",
3072+
age: 30,
3073+
};
3074+
3075+
expect(user).toEqual({
3076+
name: expect.schemaMatching(NonEmptyTrimmedString100),
3077+
age: expect.schemaMatching(PositiveInt),
3078+
});
3079+
});
30663080
});

0 commit comments

Comments
 (0)