Skip to content

Commit

Permalink
Fixed tests and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ozziest committed Sep 28, 2024
1 parent ab262d0 commit 6759a96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ By the example, you would get the following response:
"email": [
{
"rule": "required",
"message": "The field field is required."
"message": "The field is required."
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("validate() function ", () => {
const result = await validate(data, rules);
expect(result.isValid).toBe(false);
expect(result.errors.price[0].message).toBe(
"The field field must be between 1000 and 2000."
"The field must be between 1000 and 2000."
);
});

Expand Down Expand Up @@ -96,11 +96,11 @@ describe("validate() function ", () => {

const result = await validate({ email: "" }, rules, {
translations: {
required: "The field field is required. (custom translation message)",
required: "The field is required. (custom translation message)",
},
});
expect(result.errors.email[0].message).toBe(
"The field field is required. (custom translation message)"
"The field is required. (custom translation message)"
);
});

Expand Down

0 comments on commit 6759a96

Please sign in to comment.