Skip to content

Commit

Permalink
Merge pull request #142 from kristianmandrup:fix-trim
Browse files Browse the repository at this point in the history
Fixes trim - test passes
  • Loading branch information
kristianmandrup authored Mar 30, 2023
2 parents 5fd68ae + 0f820ff commit f3f17ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/types/string/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class YupString extends YupMixed {
get typeEnabled() {
return [
"normalize",
"trim",
"minLength",
"maxLength",
"pattern",
Expand Down
7 changes: 3 additions & 4 deletions test/types/string/trim.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { createStr, createSchema } from "./_helpers";
describe("trim - strict", () => {
const conf = { trim: true, strict: true, key: "name" };
describe("create schema", () => {
// TODO
test.skip("trim", () => {
test("trim", () => {
expect(createStr(conf)).toBeTruthy();
});
});
Expand All @@ -20,8 +19,8 @@ describe("trim - strict", () => {
expect(valid).toBeTruthy();
});

// todo: why does this fail!?
test.skip("invalid name - not trimmed", () => {

test("invalid name - not trimmed", () => {
const valid = schema.isValidSync({
name: " zxy124 "
});
Expand Down

0 comments on commit f3f17ef

Please sign in to comment.