diff --git a/arkcompiler/esmodule/esmodule_entry/Test.json b/arkcompiler/esmodule/esmodule_entry/Test.json index a36d26f8f757b6f3e09924c7915cc68e23c9459e..be8ec183b2f08a91d6d77c3560c5bcaab1f292fb 100644 --- a/arkcompiler/esmodule/esmodule_entry/Test.json +++ b/arkcompiler/esmodule/esmodule_entry/Test.json @@ -5,7 +5,8 @@ "test-timeout": "1800000", "bundle-name": "com.esmodule.acts", "module-name": "entry", - "shell-timeout": "180000" + "shell-timeout": "180000", + "compile-mode": "esmodule" }, "kits": [ { diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestAbility/TestAbility.ets b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestAbility/TestAbility.ets index cb027d69256099790b95a32b446978bbc64b4ecb..28e3b3be26b9bda260abd03672abca56adac9e12 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestAbility/TestAbility.ets +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestAbility/TestAbility.ets @@ -18,16 +18,15 @@ import hilog from '@ohos.hilog'; import { Hypium } from '@ohos/hypium'; import testsuite from '../test/List.test'; import window from '@ohos.window'; +import { BusinessError } from '@ohos.base'; export default class TestAbility extends UIAbility { - onCreate(want, launchParam) { + onCreate(want: object, launchParam: object) { hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + let abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) } @@ -38,7 +37,7 @@ export default class TestAbility extends UIAbility { onWindowStageCreate(windowStage: window.WindowStage) { hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + windowStage.loadContent('TestAbility/pages/Index', (err: BusinessError, data: void) => { if (err.code) { hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); return; diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestAbility/pages/Index.ets b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestAbility/pages/Index.ets index 8cbc4b3b96d8d38bc36fbd9a3173d3fd4f09db73..8e2621c6c17d9f9c89658f665a195fd1b713adbb 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestAbility/pages/Index.ets +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestAbility/pages/Index.ets @@ -32,9 +32,6 @@ struct Index { .fontSize(20) .fontWeight(FontWeight.Bold) }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) .backgroundColor('#0D9FFB') .width('35%') .height('5%') diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/DynamicImport.ets b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/DynamicImport.ets deleted file mode 100644 index a58f369d54d6e92e8fba070b536876a01aaa14b7..0000000000000000000000000000000000000000 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/DynamicImport.ets +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, it, expect} from "@ohos/hypium" - -export default function dynamicImport() { - describe("DynamicImportTest", async function () { - it('importHar', 0, async function () { - let lib = await import('har') - expect(lib.add(2, 3)).assertEqual(5) - }) - it('importRelative', 0, async function () { - let lib = await import('./test') - expect(lib.add(2, 3)).assertEqual(5) - expect(lib.default).assertEqual('test') - }) - it('importOhpm', 0, async function () { - let lib = await import('leap-year') - expect(lib.default(2000)).assertEqual(true) - }) - it('importSystemInternal', 0, async function () { - let lib = await import('@ohos.hilog') - lib.default.info(0x0000, "testTag", 'dexter log: call ohos.hilog') - }) - it('importSystemBuiltin', 0, async function () { - let lib = await import('@system.app') - lib.default.getInfo() - }) - it('importAppNapi', 0, async function () { - let lib = await import('libentry.so') - expect(lib.default.add(2,3)).assertEqual(5) - }) - }) -} - diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/List.test.ets b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/List.test.ets index d78e8bff09d35bbb5878bc27c70912d31a3cb67f..b4043934273859167cdd349070d687c88d500154 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/List.test.ets +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/List.test.ets @@ -12,13 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import dynamicImport from './DynamicImport' import staticImport from './StaticImport' import workerImport from "./WorkerImport" import pageImport from './PageImport' export default function testsuite() { - dynamicImport() staticImport() workerImport() pageImport() diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/PageImport.ets b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/PageImport.ets index d03d64d038d06ed5a0963c43c028f3f5bf76bba0..365843b62ea5946fd2f5dfd23c32cdff8d04f95c 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/PageImport.ets +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/PageImport.ets @@ -17,8 +17,8 @@ import {describe, it} from "@ohos/hypium" import {Sleep} from './Util' export default function pageImport() { - describe("PageImportTest", function () { - it('pageImportHar', 0, async function (){ + describe("PageImportTest", () => { + it('pageImportHar', 0, async () => { await Sleep(1000) router.clear() await router.pushUrl({url: "pages/PageImportHar"}) @@ -26,7 +26,7 @@ export default function pageImport() { router.back() await Sleep(1000) }) - it('pageImportOhpm', 0, async function (){ + it('pageImportOhpm', 0, async () => { await Sleep(1000) router.clear() await router.pushUrl({url: "pages/PageImportOhpm"}) @@ -34,7 +34,7 @@ export default function pageImport() { router.back() await Sleep(1000) }) - it('pageImportRelative', 0, async function (){ + it('pageImportRelative', 0, async () => { await Sleep(1000) router.clear() await router.pushUrl({url: "pages/PageImportRelative"}) @@ -42,7 +42,7 @@ export default function pageImport() { router.back() await Sleep(1000) }) - it('pageImportAppNapi', 0, async function (){ + it('pageImportAppNapi', 0, async () => { await Sleep(1000) router.clear() await router.pushUrl({url: "pages/PageImportNapi"}) @@ -50,7 +50,7 @@ export default function pageImport() { router.back() await Sleep(1000) }) - it('pageImportSystemNapi', 0, async function (){ + it('pageImportSystemNapi', 0, async () => { await Sleep(1000) router.clear() await router.pushUrl({url: "pages/PageImportSystem"}) diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/StaticImport.ets b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/StaticImport.ets index d943a3e9c59316d056fef11779dd5fdd0d308540..8cf0d4f83c6a01e3b4bddafe24d38992a5a74700 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/StaticImport.ets +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/StaticImport.ets @@ -22,26 +22,26 @@ import app from "@system.app" import testNapi from "libentry.so" export default function staticImport() { - describe("StaticImportTest", function () { - it('importHar', 0, function () { + describe("StaticImportTest", () => { + it('importHar', 0, () => { expect(add1(2, 3)).assertEqual(5) }) - it('importRelative', 0, function () { + it('importRelative', 0, () => { expect(add2(2, 3)).assertEqual(5) }) - it('importOhpm', 0, function () { + it('importOhpm', 0, () => { expect(isLeapYear1(2000)).assertEqual(true) }) - it('importSystemInternal', 0, function () { + it('importSystemInternal', 0, () => { hilog.info(0x0000, "testTag", 'dexter log: call ohos.hilog') }) - it('importSystemBuiltin', 0, function () { + it('importSystemBuiltin', 0, () => { app.getInfo() }) - it("harImportOhpm", 0, function () { + it("harImportOhpm", 0, () => { expect(ohpmRes).assertEqual(true) }) - it("importAppNapi", 0, function() { + it("importAppNapi", 0,() => { expect(testNapi.add(2, 3)).assertEqual(5) }) }) diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/Util.ets b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/Util.ts similarity index 90% rename from arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/Util.ets rename to arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/Util.ts index 55e85af8f6dde5c6a0a26208308bcf8d194e4988..3500d9733dd6c4333f6bab9e2b066ec22d1a9354 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/Util.ets +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/Util.ts @@ -12,6 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export const Sleep = (ms)=> { +export const Sleep = (ms: number | undefined)=> { return new Promise(resolve=>setTimeout(resolve, ms)) } \ No newline at end of file diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/WorkerImport.ets b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/WorkerImport.ets index d4869f4cd7e666de3268eb581466489b389cf812..0facff251d3729fec7fc82bdca9eb4234dd9c3c6 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/WorkerImport.ets +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/test/WorkerImport.ets @@ -17,52 +17,42 @@ import { describe, it, expect } from "@ohos/hypium" import {Sleep} from './Util' export default function workerImport() { - describe("WorkerImportTest", function () { - it('importHar', 0, async function () { - let workerImportHar = 'failed' - let threadWorker = new worker.ThreadWorker('entry/ets/workers/workerImportHar') - threadWorker.postMessage("ModuleTest host to worker") - threadWorker.onmessage = function () { - workerImportHar = 'success'; - } - await Sleep(2000) - expect(workerImportHar).assertEqual('success') - }) - it('importOhpm', 0, async function () { + describe("WorkerImportTest", () => { + it('importOhpm', 0, async () => { let workerImportOhpm = 'failed' let threadWorker = new worker.ThreadWorker('entry/ets/workers/workerImportOhpm') threadWorker.postMessage("ModuleTest host to worker") - threadWorker.onmessage = function () { + threadWorker.onmessage = () => { workerImportOhpm = 'success'; } await Sleep(2000) expect(workerImportOhpm).assertEqual('success') }) - it('importRelative', 0, async function () { + it('importRelative', 0, async () => { let workerImportRelative = 'failed' let threadWorker = new worker.ThreadWorker('entry/ets/workers/workerImportRelative') threadWorker.postMessage("ModuleTest host to worker") - threadWorker.onmessage = function () { + threadWorker.onmessage = () => { workerImportRelative = 'success'; } await Sleep(2000) expect(workerImportRelative).assertEqual('success') }) - it('importSystemNapi', 0, async function () { + it('importSystemNapi', 0, async () => { let workerImportSystem = 'failed' let threadWorker = new worker.ThreadWorker('entry/ets/workers/workerImportSystem') threadWorker.postMessage("ModuleTest host to worker") - threadWorker.onmessage = function () { + threadWorker.onmessage = () => { workerImportSystem = 'success'; } await Sleep(2000) expect(workerImportSystem).assertEqual('success') }) - it('importAppNapi', 0, async function () { + it('importAppNapi', 0, async () => { let workerImportNapi = 'failed' let threadWorker = new worker.ThreadWorker('entry/ets/workers/workerImportNapi') threadWorker.postMessage("ModuleTest host to worker") - threadWorker.onmessage = function () { + threadWorker.onmessage = () => { workerImportNapi = 'success'; } await Sleep(2000) diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/testrunner/OpenHarmonyTestRunner.ts similarity index 100% rename from arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/testrunner/OpenHarmonyTestRunner.ts diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportHar.ts b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportHar.ts deleted file mode 100644 index 95708daec385ee385fe69548632f0c6c99b3568d..0000000000000000000000000000000000000000 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportHar.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {ohpmRes} from 'har'; -import worker from '@ohos.worker'; - -let workerPort = worker.workerPort; -workerPort.onmessage = function(): void { - if (ohpmRes) { - workerPort.postMessage('ModuleTest receive data from main thread'); - } -}; \ No newline at end of file diff --git a/arkcompiler/esmodule/esmodule_entry/har/index.ets b/arkcompiler/esmodule/esmodule_entry/har/index.ets index f93b72847d15fe14b7b6736ba880e234f95cd085..e9912b7fec961dde0287411ff2c99fcce04da8ea 100644 --- a/arkcompiler/esmodule/esmodule_entry/har/index.ets +++ b/arkcompiler/esmodule/esmodule_entry/har/index.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export var A = "I am har1"; +export let A = "I am har1"; export { MainPage } from './src/main/ets/components/mainpage/MainPage'; export {ohpmRes} from './src/main/ets/ohpm'; function add(a: number, b: number) { diff --git a/arkcompiler/esmodule/esmodule_entry/oh-package-lock.json5 b/arkcompiler/esmodule/esmodule_entry/oh-package-lock.json5 deleted file mode 100644 index 2c203c52321bf7ef3e02962176b1f300bfc83be4..0000000000000000000000000000000000000000 --- a/arkcompiler/esmodule/esmodule_entry/oh-package-lock.json5 +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -{ - "lockfileVersion": 1, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6", - "leap-year@^4.0.0": "leap-year@4.0.0", - "leap-year@4.0.0": "leap-year@4.0.0" - }, - "packages": { - "@ohos/hypium@1.0.6": { - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", - "integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==" - }, - "leap-year@4.0.0": { - "resolved": "https://repo.harmonyos.com/ohpm/leap-year/-/leap-year-4.0.0.tgz", - "integrity": "sha512-+GveCBnhFmRjFf04Nj/2Z/w5lNC4bRXpecIRz5QkK+LnWBwuf9jAaNEfbybrU+e2ls8J6p+FZMjiq1aEh+gPAw==" - } - } -} \ No newline at end of file diff --git a/arkcompiler/esmodule/esmodule_ohostest/Test.json b/arkcompiler/esmodule/esmodule_ohostest/Test.json index ce403928d0dbf947cf2dffc7a198b71637d572b5..94ea6936a9d168a25c6eb4b14ce57793f9046f66 100644 --- a/arkcompiler/esmodule/esmodule_ohostest/Test.json +++ b/arkcompiler/esmodule/esmodule_ohostest/Test.json @@ -5,7 +5,8 @@ "test-timeout": "1800000", "bundle-name": "com.esmodule.acts", "module-name": "entry_test", - "shell-timeout": "180000" + "shell-timeout": "180000", + "compile-mode": "esmodule" }, "kits": [ { diff --git a/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestAbility/TestAbility.ets b/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestAbility/TestAbility.ets index b4f773d3ee5ec247a7a60df90fd3afc49c1a6e3d..791e4ce042e9919aa0076377fcaa20eb99e36085 100644 --- a/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestAbility/TestAbility.ets +++ b/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestAbility/TestAbility.ets @@ -18,16 +18,15 @@ import hilog from '@ohos.hilog'; import { Hypium } from '@ohos/hypium'; import testsuite from '../test/List.test'; import window from '@ohos.window'; +import { BusinessError } from '@ohos.base'; export default class TestAbility extends UIAbility { - onCreate(want, launchParam) { + onCreate(want: object, launchParam: object) { hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + let abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) } @@ -38,7 +37,7 @@ export default class TestAbility extends UIAbility { onWindowStageCreate(windowStage: window.WindowStage) { hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + windowStage.loadContent('TestAbility/pages/Index', (err: BusinessError, data: void) => { if (err.code) { hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); return; diff --git a/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestAbility/pages/Index.ets b/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestAbility/pages/Index.ets index df9bc42721d0872e16ff9635e35de72c1a0559e6..0ed8f03ebf84d391bdb151bb925a021710c7ae7e 100644 --- a/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestAbility/pages/Index.ets +++ b/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestAbility/pages/Index.ets @@ -32,9 +32,6 @@ struct Index { .fontSize(20) .fontWeight(FontWeight.Bold) }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) .backgroundColor('#0D9FFB') .width('35%') .height('5%') diff --git a/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/test/StaticImport.ets b/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/test/StaticImport.ets index ca0689cdd2e4bfa987dc48eb622c57280de379af..d964ce6ee09a5ac260c0a94b73db30adfc8eaf86 100644 --- a/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/test/StaticImport.ets +++ b/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/test/StaticImport.ets @@ -22,26 +22,26 @@ import app from "@system.app" import testNapi from "libentry.so" export default function staticImport() { - describe("StaticImportTest", function () { - it('importHar', 0, function () { + describe("StaticImportTest", () => { + it('importHar', 0, () => { expect(add1(2, 3)).assertEqual(5) }) - it('importRelative', 0, function () { + it('importRelative', 0, () => { expect(add2(2, 3)).assertEqual(5) }) - it('importOhpm', 0, function () { + it('importOhpm', 0, () => { expect(isLeapYear1(2000)).assertEqual(true) }) - it('importSystemInternal', 0, function () { + it('importSystemInternal', 0, () => { hilog.info(0x0000, "testTag", 'dexter log: call ohos.hilog') }) - it('importSystemBuiltin', 0, function () { + it('importSystemBuiltin', 0, () => { app.getInfo() }) - it("harImportOhpm", 0, function () { + it("harImportOhpm", 0, () => { expect(ohpmRes).assertEqual(true) }) - it("ImportAppNapi", 0, function () { + it("ImportAppNapi", 0, () => { expect(testNapi.add(2, 3)).assertEqual(5) }) }) diff --git a/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts similarity index 100% rename from arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts rename to arkcompiler/esmodule/esmodule_ohostest/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts diff --git a/arkcompiler/esmodule/esmodule_ohostest/har/index.ets b/arkcompiler/esmodule/esmodule_ohostest/har/index.ets index 1dd8a0dbe43d663bbe8ae6426402fc1b0cf1bc9f..b8d78001cf2a5b66641e77d5020d4be78a690913 100644 --- a/arkcompiler/esmodule/esmodule_ohostest/har/index.ets +++ b/arkcompiler/esmodule/esmodule_ohostest/har/index.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export var A = "I am har1"; +export let A = "I am har1"; export { MainPage } from './src/main/ets/components/mainpage/MainPage'; export {ohpmRes} from './src/main/ets/ohpm'; function add(a: number, b: number) { diff --git a/arkcompiler/esmodule/esmodule_ohostest/oh-package-lock.json5 b/arkcompiler/esmodule/esmodule_ohostest/oh-package-lock.json5 deleted file mode 100644 index 1e08ee6bb9575885abe07d38d20a6e9b9cdb97d5..0000000000000000000000000000000000000000 --- a/arkcompiler/esmodule/esmodule_ohostest/oh-package-lock.json5 +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - "lockfileVersion": 1, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6", - "leap-year@^4.0.0": "leap-year@4.0.0", - "leap-year@4.0.0": "leap-year@4.0.0" - }, - "packages": { - "@ohos/hypium@1.0.6": { - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", - "integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==" - }, - "leap-year@4.0.0": { - "resolved": "https://repo.harmonyos.com/ohpm/leap-year/-/leap-year-4.0.0.tgz", - "integrity": "sha512-+GveCBnhFmRjFf04Nj/2Z/w5lNC4bRXpecIRz5QkK+LnWBwuf9jAaNEfbybrU+e2ls8J6p+FZMjiq1aEh+gPAw==" - } - } -} \ No newline at end of file diff --git a/arkcompiler/esmodule/esmodule_ohostestlib/Test.json b/arkcompiler/esmodule/esmodule_ohostestlib/Test.json index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..94ea6936a9d168a25c6eb4b14ce57793f9046f66 100644 --- a/arkcompiler/esmodule/esmodule_ohostestlib/Test.json +++ b/arkcompiler/esmodule/esmodule_ohostestlib/Test.json @@ -0,0 +1,21 @@ +{ + "description": "Configuration for esmodule_ohostest_hap Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "1800000", + "bundle-name": "com.esmodule.acts", + "module-name": "entry_test", + "shell-timeout": "180000", + "compile-mode": "esmodule" + }, + "kits": [ + { + "test-file-name": [ + "ActsEsmoduleOhostestLib.hap", + "ActsEsmoduleOhostestTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/arkcompiler/esmodule/esmodule_ohostestlib/oh-package-lock.json5 b/arkcompiler/esmodule/esmodule_ohostestlib/oh-package-lock.json5 deleted file mode 100644 index b91ced5c88bc49adea9726c6dfef7919431d7e3b..0000000000000000000000000000000000000000 --- a/arkcompiler/esmodule/esmodule_ohostestlib/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - "lockfileVersion": 1, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6" - }, - "packages": { - "@ohos/hypium@1.0.6": { - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", - "integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==" - } - } -} \ No newline at end of file