From 64111df05c33d275ac5e39cc6197df4532681a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Adem=20I=C5=9EIKLI?= Date: Sat, 28 Sep 2024 13:16:17 +0200 Subject: [PATCH] Fixed tests and docs --- docs/getting-started.md | 2 +- tests/index.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index d42f6d8..58b018e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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." } ] } diff --git a/tests/index.test.ts b/tests/index.test.ts index 561cd1f..967ff04 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -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." ); }); @@ -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)" ); });