Skip to content

Commit 12d8899

Browse files
committed
fix string trim
1 parent aba467e commit 12d8899

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/zod-fast-check.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ const arbitraryBuilders: ArbitraryBuilders = {
244244
mappings.push((s) => s + check.value);
245245
break;
246246
case "trim":
247-
// No special handling needed for inputs.
247+
mappings.push((s) => s.trim());
248248
break;
249249
case "cuid":
250250
return createCuidArb();

tests/zod-fast-check.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ describe("Generate arbitraries for Zod schema output types", () => {
274274

275275
return fc.assert(
276276
fc.property(arbitrary, (value) => {
277-
value.match(/^\s/) === null && value.match(/\s$/) === null;
277+
expect(value.match(/^\s/)).toEqual(null);
278+
expect(value.match(/\s$/)).toEqual(null);
278279
})
279280
);
280281
});

0 commit comments

Comments
 (0)