From db925aa58137a7c176f040a97848a62b59c97c6a Mon Sep 17 00:00:00 2001 From: sunyichen Date: Mon, 16 Jun 2025 16:52:53 +0800 Subject: [PATCH] Modify error message for filename check Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/ICFIQW Signed-off-by: sunyichen Change-Id: I13bf87238640676e9fed885c325bc1948f5383ad --- compiler/src/ark_utils.ts | 12 ++++++------ .../ark_compiler_ut/module/ohmUrl/ohmUrl.test.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index 70674432f..5a7536a2a 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -130,8 +130,8 @@ export function getNormalizedOhmUrlByFilepath(filePath: string, projectConfig: O 'Failed to resolve OhmUrl. ' + `Failed to get a resolved OhmUrl for "${filePath}" imported by "${importerFile}".`, '', - [`Check whether the "${pkgName}" module which ${filePath} belongs to is correctly configured.`, - 'Check the corresponding file name is correct(including case-sensitivity).'] + [`Check whether the "${pkgName}" module which ${filePath} belongs to is correctly configured.`, + `Check if the corresponding file name "${filePath}" is correct(including case-sensitivity).`] ); logger.printError(errInfo); return filePath; @@ -230,8 +230,8 @@ function processPackageDir(params: Object): string { 'Failed to resolve OhmUrl. ' + `Failed to get a resolved OhmUrl for "${originalFilePath}" imported by "${importerFile}".`, '', - [`Check whether the module which ${originalFilePath} belongs to is correctly configured.`, - 'Check the corresponding file name is correct(including case-sensitivity).'] + [`Check whether the module which ${originalFilePath} belongs to is correctly configured.`, + `Check if the corresponding file name "${originalFilePath}" is correct(including case-sensitivity).`] ); logger.printError(errInfo); return originalFilePath; @@ -269,8 +269,8 @@ function processPackageDir(params: Object): string { 'Failed to resolve OhmUrl. ' + `Failed to get a resolved OhmUrl for "${originalFilePath}" imported by "${importerFile}".`, '', - [`Check whether the module which ${originalFilePath} belongs to is correctly configured.`, - 'Check the corresponding file name is correct(including case-sensitivity).'] + [`Check whether the module which ${originalFilePath} belongs to is correctly configured.`, + `Check if the corresponding file name "${originalFilePath}" is correct(including case-sensitivity).`] ); logger.printError(errInfo); return originalFilePath; diff --git a/compiler/test/ark_compiler_ut/module/ohmUrl/ohmUrl.test.ts b/compiler/test/ark_compiler_ut/module/ohmUrl/ohmUrl.test.ts index 7f09e32a6..8455fd83a 100644 --- a/compiler/test/ark_compiler_ut/module/ohmUrl/ohmUrl.test.ts +++ b/compiler/test/ark_compiler_ut/module/ohmUrl/ohmUrl.test.ts @@ -191,7 +191,7 @@ mocha.describe('generate ohmUrl', function () { 'Failed to get a resolved OhmUrl for "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" imported by "importTest.ts".', '', ['Check whether the module which /testProjectRootPath/entry/oh_modules/json5/dist/index.js belongs to is correctly configured.', - 'Check the corresponding file name is correct(including case-sensitivity).'] + 'Check if the corresponding file name "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" is correct(including case-sensitivity).'] ); const logger = CommonLogger.getInstance(this.rollup); const stub = sinon.stub(logger.getLoggerFromErrorCode(errInfo.code), 'printError'); @@ -213,7 +213,7 @@ mocha.describe('generate ohmUrl', function () { 'Failed to get a resolved OhmUrl for "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" imported by "importTest.ts".', '', ['Check whether the module which /testProjectRootPath/entry/oh_modules/json5/dist/index.js belongs to is correctly configured.', - 'Check the corresponding file name is correct(including case-sensitivity).'] + 'Check if the corresponding file name "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" is correct(including case-sensitivity).'] ); CommonLogger.destroyInstance(); const getHvigorConsoleLogger = this.rollup.share.getHvigorConsoleLogger; @@ -241,7 +241,7 @@ mocha.describe('generate ohmUrl', function () { '"/testProjectRootPath/entry/oh_modules/json5/dist/index.js" imported by "importTest.ts".', '', ['Check whether the module which /testProjectRootPath/entry/oh_modules/json5/dist/index.js belongs to is correctly configured.', - 'Check the corresponding file name is correct(including case-sensitivity).'] + 'Check if the corresponding file name "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" is correct(including case-sensitivity).'] ); const logger = CommonLogger.getInstance(this.rollup); const stub = sinon.stub(logger.getLoggerFromErrorCode(errInfo.code), 'printError'); @@ -265,7 +265,7 @@ mocha.describe('generate ohmUrl', function () { '"/testProjectRootPath/entry/oh_modules/json5/dist/index.js" imported by "importTest.ts".', '', ['Check whether the module which /testProjectRootPath/entry/oh_modules/json5/dist/index.js belongs to is correctly configured.', - 'Check the corresponding file name is correct(including case-sensitivity).'] + 'Check if the corresponding file name "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" is correct(including case-sensitivity).'] ); CommonLogger.destroyInstance(); const getHvigorConsoleLogger = this.rollup.share.getHvigorConsoleLogger; @@ -972,7 +972,7 @@ mocha.describe('generate ohmUrl', function () { 'Failed to get a resolved OhmUrl for "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" imported by "importTest.ts".', '', ['Check whether the "json5" module which /testProjectRootPath/entry/oh_modules/json5/dist/index.js belongs to is correctly configured.', - 'Check the corresponding file name is correct(including case-sensitivity).'] + 'Check if the corresponding file name "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" is correct(including case-sensitivity).'] ); const logger = CommonLogger.getInstance(this.rollup); const stub = sinon.stub(logger.getLoggerFromErrorCode(errInfo.code), 'printError'); @@ -1004,7 +1004,7 @@ mocha.describe('generate ohmUrl', function () { 'Failed to get a resolved OhmUrl for "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" imported by "importTest.ts".', '', ['Check whether the "json5" module which /testProjectRootPath/entry/oh_modules/json5/dist/index.js belongs to is correctly configured.', - 'Check the corresponding file name is correct(including case-sensitivity).'] + 'Check if the corresponding file name "/testProjectRootPath/entry/oh_modules/json5/dist/index.js" is correct(including case-sensitivity).'] ); CommonLogger.destroyInstance(); const getHvigorConsoleLogger = this.rollup.share.getHvigorConsoleLogger; -- Gitee