From 8cbd0446f0a10aa4d5197ba5d7cc5ba3955dfd5b Mon Sep 17 00:00:00 2001 From: tuanphamcybozu <41720778+tuanphamcybozu@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:03:02 +0700 Subject: [PATCH] fix(plugin-manifest-validator): update default non-existent file message (#2253) --- packages/plugin-manifest-validator/src/__tests__/index.ts | 4 ++-- packages/plugin-manifest-validator/src/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/plugin-manifest-validator/src/__tests__/index.ts b/packages/plugin-manifest-validator/src/__tests__/index.ts index 5387034e08..eac93d97eb 100644 --- a/packages/plugin-manifest-validator/src/__tests__/index.ts +++ b/packages/plugin-manifest-validator/src/__tests__/index.ts @@ -380,7 +380,7 @@ describe("validator", () => { assert.deepStrictEqual(error, { instancePath, keyword: "fileExists", - message: `File not found: ${filePath}`, + message: `file should exist ("${filePath}")`, schemaPath, }); } @@ -420,7 +420,7 @@ describe("validator", () => { errorIndex = 1; } - const customMessage = "Custom message: File not found 404"; + const customMessage = `Custom message: file should exist ("config/not_exist.js")`; const actual = validator(json(source), { fileExists: (path) => { return { diff --git a/packages/plugin-manifest-validator/src/index.ts b/packages/plugin-manifest-validator/src/index.ts index b378584a47..11682912e0 100644 --- a/packages/plugin-manifest-validator/src/index.ts +++ b/packages/plugin-manifest-validator/src/index.ts @@ -109,7 +109,7 @@ export default ( } const result = fileExists(filePath); - const defaultMessage = `File not found: ${filePath}`; + const defaultMessage = `file should exist ("${filePath}")`; if (result === false) { validateFileExists.errors = [