Skip to content

Commit c97f9c8

Browse files
chore: updated tests for sync check
1 parent ba2afb7 commit c97f9c8

File tree

10 files changed

+113
-15
lines changed

10 files changed

+113
-15
lines changed

tests/sync/__snapshots__/arktype.test.ts.snap

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,27 @@
22

33
exports[`sync check > arktype 1`] = `
44
{
5-
"__quansync": true,
6-
"then": [Function],
5+
"$schema": "https://json-schema.org/draft/2020-12/schema",
6+
"description": "My neat object schema",
7+
"properties": {
8+
"myString": {
9+
"type": "string",
10+
},
11+
"myUnion": {
12+
"anyOf": [
13+
{
14+
"type": "number",
15+
},
16+
{
17+
"type": "boolean",
18+
},
19+
],
20+
},
21+
},
22+
"required": [
23+
"myString",
24+
"myUnion",
25+
],
26+
"type": "object",
727
}
828
`;

tests/sync/__snapshots__/valibot.test.ts.snap

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,27 @@
22

33
exports[`sync check > valibot 1`] = `
44
{
5-
"__quansync": true,
6-
"then": [Function],
5+
"$schema": "http://json-schema.org/draft-07/schema#",
6+
"description": "My neat object schema",
7+
"properties": {
8+
"myString": {
9+
"type": "string",
10+
},
11+
"myUnion": {
12+
"anyOf": [
13+
{
14+
"type": "number",
15+
},
16+
{
17+
"type": "boolean",
18+
},
19+
],
20+
},
21+
},
22+
"required": [
23+
"myString",
24+
"myUnion",
25+
],
26+
"type": "object",
727
}
828
`;

tests/sync/__snapshots__/zodv3.test.ts.snap

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@
22

33
exports[`sync check > zodv3 1`] = `
44
{
5-
"__quansync": true,
6-
"then": [Function],
5+
"$schema": "http://json-schema.org/draft-07/schema#",
6+
"additionalProperties": false,
7+
"description": "My neat object schema",
8+
"properties": {
9+
"myString": {
10+
"type": "string",
11+
},
12+
"myUnion": {
13+
"type": [
14+
"number",
15+
"boolean",
16+
],
17+
},
18+
},
19+
"required": [
20+
"myString",
21+
"myUnion",
22+
],
23+
"type": "object",
724
}
825
`;

tests/sync/__snapshots__/zodv4-mini.test.ts.snap

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,27 @@
22

33
exports[`sync check > zodv4-mini 1`] = `
44
{
5-
"__quansync": true,
6-
"then": [Function],
5+
"$schema": "https://json-schema.org/draft/2020-12/schema",
6+
"additionalProperties": false,
7+
"properties": {
8+
"myString": {
9+
"type": "string",
10+
},
11+
"myUnion": {
12+
"anyOf": [
13+
{
14+
"type": "number",
15+
},
16+
{
17+
"type": "boolean",
18+
},
19+
],
20+
},
21+
},
22+
"required": [
23+
"myString",
24+
"myUnion",
25+
],
26+
"type": "object",
727
}
828
`;

tests/sync/__snapshots__/zodv4.test.ts.snap

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,28 @@
22

33
exports[`sync check > zodv4 1`] = `
44
{
5-
"__quansync": true,
6-
"then": [Function],
5+
"$schema": "https://json-schema.org/draft/2020-12/schema",
6+
"additionalProperties": false,
7+
"description": "My neat object schema",
8+
"properties": {
9+
"myString": {
10+
"type": "string",
11+
},
12+
"myUnion": {
13+
"anyOf": [
14+
{
15+
"type": "number",
16+
},
17+
{
18+
"type": "boolean",
19+
},
20+
],
21+
},
22+
},
23+
"required": [
24+
"myString",
25+
"myUnion",
26+
],
27+
"type": "object",
728
}
829
`;

tests/sync/arktype.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("sync check", () => {
1515
myUnion: "number | boolean",
1616
}).describe("My neat object schema");
1717

18-
const jsonSchema = toJsonSchema(schema);
18+
const jsonSchema = toJsonSchema.sync(schema);
1919
expect(jsonSchema).toMatchSnapshot();
2020
});
2121
});

tests/sync/valibot.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("sync check", () => {
1818
v.description("My neat object schema"),
1919
);
2020

21-
const jsonSchema = toJsonSchema(schema);
21+
const jsonSchema = toJsonSchema.sync(schema);
2222
expect(jsonSchema).toMatchSnapshot();
2323
});
2424
});

tests/sync/zodv3.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("sync check", () => {
1717
})
1818
.describe("My neat object schema");
1919

20-
const zod3JsonSchema = toJsonSchema(zod3Schema);
20+
const zod3JsonSchema = toJsonSchema.sync(zod3Schema);
2121
expect(zod3JsonSchema).toMatchSnapshot();
2222
});
2323
});

tests/sync/zodv4-mini.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("sync check", () => {
1515
myUnion: z.union([z.number(), z.boolean()]),
1616
});
1717

18-
const zod4JsonSchema = toJsonSchema(zod4Schema);
18+
const zod4JsonSchema = toJsonSchema.sync(zod4Schema);
1919
expect(zod4JsonSchema).toMatchSnapshot();
2020
});
2121
});

tests/sync/zodv4.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("sync check", () => {
1717
})
1818
.describe("My neat object schema");
1919

20-
const zod4JsonSchema = toJsonSchema(zod4Schema);
20+
const zod4JsonSchema = toJsonSchema.sync(zod4Schema);
2121
expect(zod4JsonSchema).toMatchSnapshot();
2222
});
2323
});

0 commit comments

Comments
 (0)