From 39d8cb3f005752a3af0996c2568eecd9ec98f0a6 Mon Sep 17 00:00:00 2001 From: sunyichen Date: Mon, 26 May 2025 18:00:54 +0800 Subject: [PATCH] Modify error message for filename check Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/ICAMYI Signed-off-by: sunyichen Change-Id: I1f867e319e6791dd66ac5f22832812a3c415f09c --- compiler/src/ark_utils.ts | 6 +++--- .../ark_compiler_ut/module/ohmUrl/ohmUrl.test.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index a9f1f4eae..52bba5f82 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -131,7 +131,7 @@ export function getNormalizedOhmUrlByFilepath(filePath: string, projectConfig: O `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 if the corresponding file name "${filePath}" is correct(including case-sensitivity).`] ); logger.printError(errInfo); return filePath; @@ -231,7 +231,7 @@ function processPackageDir(params: Object): string { `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 if the corresponding file name "${originalFilePath}" is correct(including case-sensitivity).`] ); logger.printError(errInfo); return originalFilePath; @@ -270,7 +270,7 @@ function processPackageDir(params: Object): string { `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 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 2e6514a7e..fb70f5f06 100644 --- a/compiler/test/ark_compiler_ut/module/ohmUrl/ohmUrl.test.ts +++ b/compiler/test/ark_compiler_ut/module/ohmUrl/ohmUrl.test.ts @@ -202,7 +202,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'); @@ -224,7 +224,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; @@ -252,7 +252,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'); @@ -276,7 +276,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; @@ -983,7 +983,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'); @@ -1015,7 +1015,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