From 4fb17de2d619ba01608e48d6896d29175f3fc7ea Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Wed, 12 Feb 2025 18:15:34 +0300 Subject: [PATCH 1/9] get rid of 'chai' in runtime tests Signed-off-by: Sergey Malenkov --- incremental/runtime/oh-package.json5 | 3 --- incremental/runtime/package.json | 3 --- incremental/runtime/test/animation/Easing.test.ts | 4 ++-- incremental/runtime/test/common/MarkableQueue.test.ts | 4 ++-- incremental/runtime/test/memo/bind.test.ts | 2 +- incremental/runtime/test/memo/changeListener.test.ts | 4 ++-- incremental/runtime/test/memo/contextLocal.test.ts | 4 ++-- incremental/runtime/test/memo/remember.test.ts | 4 ++-- incremental/runtime/test/memo/repeat.test.ts | 4 ++-- incremental/runtime/test/states/Journal.test.ts | 4 ++-- incremental/runtime/test/states/State.test.ts | 2 +- incremental/runtime/test/states/state_basics.test.ts | 4 ++-- incremental/runtime/test/tree/TreeNode.test.ts | 4 ++-- incremental/runtime/test/tree/TreePath.test.ts | 4 ++-- 14 files changed, 22 insertions(+), 28 deletions(-) diff --git a/incremental/runtime/oh-package.json5 b/incremental/runtime/oh-package.json5 index c282b8826..5dc6bc9a7 100644 --- a/incremental/runtime/oh-package.json5 +++ b/incremental/runtime/oh-package.json5 @@ -25,11 +25,8 @@ "@koalaui/compat": "1.4.1+devel" }, "devDependencies": { - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", "mocha": "^9.2.2", diff --git a/incremental/runtime/package.json b/incremental/runtime/package.json index aa8066c4c..8dc62e078 100644 --- a/incremental/runtime/package.json +++ b/incremental/runtime/package.json @@ -46,11 +46,8 @@ "@koalaui/harness": "1.5.4+devel" }, "devDependencies": { - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", "mocha": "^9.2.2", diff --git a/incremental/runtime/test/animation/Easing.test.ts b/incremental/runtime/test/animation/Easing.test.ts index f648ccf37..8b41c853c 100644 --- a/incremental/runtime/test/animation/Easing.test.ts +++ b/incremental/runtime/test/animation/Easing.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { Easing, EasingCurve, EasingStepJump } from "../../src/animation/Easing" function assertEasing(easing: EasingCurve, ...expected: number[]) { diff --git a/incremental/runtime/test/common/MarkableQueue.test.ts b/incremental/runtime/test/common/MarkableQueue.test.ts index 58f9de2b1..7d7aa326d 100644 --- a/incremental/runtime/test/common/MarkableQueue.test.ts +++ b/incremental/runtime/test/common/MarkableQueue.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,8 +13,8 @@ * limitations under the License. */ +import { Assert, suite, test } from "@koalaui/harness" import { MarkableQueue, markableQueue } from "@koalaui/common" -import { assert as Assert } from "chai" const collector = new Array() diff --git a/incremental/runtime/test/memo/bind.test.ts b/incremental/runtime/test/memo/bind.test.ts index 0fe1ab75a..d889d47fc 100644 --- a/incremental/runtime/test/memo/bind.test.ts +++ b/incremental/runtime/test/memo/bind.test.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { GlobalStateManager, State, diff --git a/incremental/runtime/test/memo/changeListener.test.ts b/incremental/runtime/test/memo/changeListener.test.ts index 975be91f1..e200f0d9b 100644 --- a/incremental/runtime/test/memo/changeListener.test.ts +++ b/incremental/runtime/test/memo/changeListener.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { GlobalStateManager, OnChange, diff --git a/incremental/runtime/test/memo/contextLocal.test.ts b/incremental/runtime/test/memo/contextLocal.test.ts index 4d901e4e3..b0cc6cfc9 100644 --- a/incremental/runtime/test/memo/contextLocal.test.ts +++ b/incremental/runtime/test/memo/contextLocal.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { State, TestNode, diff --git a/incremental/runtime/test/memo/remember.test.ts b/incremental/runtime/test/memo/remember.test.ts index a5c53f9d7..3596bb8df 100644 --- a/incremental/runtime/test/memo/remember.test.ts +++ b/incremental/runtime/test/memo/remember.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { GlobalStateManager, State, diff --git a/incremental/runtime/test/memo/repeat.test.ts b/incremental/runtime/test/memo/repeat.test.ts index 392cd1a1e..f489f8a4b 100644 --- a/incremental/runtime/test/memo/repeat.test.ts +++ b/incremental/runtime/test/memo/repeat.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { UniqueId, KoalaCallsiteKey } from "@koalaui/common" import { GlobalStateManager, diff --git a/incremental/runtime/test/states/Journal.test.ts b/incremental/runtime/test/states/Journal.test.ts index 712e8b550..74439ca86 100644 --- a/incremental/runtime/test/states/Journal.test.ts +++ b/incremental/runtime/test/states/Journal.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert as Assert } from "chai" +import { Assert, suite, test } from "@koalaui/harness" import { Changes, Journal } from "../../src/states/Journal" function assertChange(changes: Changes | undefined, state: Object, expected: Value) { diff --git a/incremental/runtime/test/states/State.test.ts b/incremental/runtime/test/states/State.test.ts index 65c7d833b..99e5edacc 100644 --- a/incremental/runtime/test/states/State.test.ts +++ b/incremental/runtime/test/states/State.test.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { UniqueId, KoalaCallsiteKey } from "@koalaui/common" import { IncrementalNode, MutableState, State, TestNode, testUpdate, ValueTracker } from "../../src" import { createStateManager } from "../../src/states/State" diff --git a/incremental/runtime/test/states/state_basics.test.ts b/incremental/runtime/test/states/state_basics.test.ts index 3652ecaf3..13f667e59 100644 --- a/incremental/runtime/test/states/state_basics.test.ts +++ b/incremental/runtime/test/states/state_basics.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { uint32 } from "@koalaui/common" import { GlobalStateManager, diff --git a/incremental/runtime/test/tree/TreeNode.test.ts b/incremental/runtime/test/tree/TreeNode.test.ts index 365db44ca..3fae69b18 100644 --- a/incremental/runtime/test/tree/TreeNode.test.ts +++ b/incremental/runtime/test/tree/TreeNode.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { TreeNode } from "../../src/tree/TreeNode" class StringNode extends TreeNode { diff --git a/incremental/runtime/test/tree/TreePath.test.ts b/incremental/runtime/test/tree/TreePath.test.ts index 0a3110f6d..f13e34178 100644 --- a/incremental/runtime/test/tree/TreePath.test.ts +++ b/incremental/runtime/test/tree/TreePath.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import { TreePath } from "../../src/tree/TreePath" suite("TreePath", () => { -- Gitee From aeea86f9addbfb6b6d28969850648ead5f468f8b Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 14 Feb 2025 14:29:33 +0300 Subject: [PATCH 2/9] build harness before testing Signed-off-by: Sergey Malenkov --- incremental/runtime/.gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/incremental/runtime/.gitlab-ci.yml b/incremental/runtime/.gitlab-ci.yml index 56b5b2e8d..d6ef49604 100644 --- a/incremental/runtime/.gitlab-ci.yml +++ b/incremental/runtime/.gitlab-ci.yml @@ -51,6 +51,7 @@ test runtime: - build compat - build compiler-plugin - build runtime + - build harness test runtime (ArkTS): stage: test -- Gitee From 990d6a0f411b67f19cdbda758bf9e70bcecc6e6a Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 14 Feb 2025 18:06:45 +0300 Subject: [PATCH 3/9] get rid of 'chai' in ets-plugin tests Signed-off-by: Sergey Malenkov --- arkoala/ets-plugin/.gitlab-ci.yml | 6 ++++++ arkoala/ets-plugin/package.json | 7 +++---- arkoala/ets-plugin/test/rewrites.test.ts | 3 ++- .../ets-plugin/test/specification/specification.test.ts | 3 ++- arkoala/ets-plugin/test/utils.ts | 4 ++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/arkoala/ets-plugin/.gitlab-ci.yml b/arkoala/ets-plugin/.gitlab-ci.yml index 1f26c8b83..2f526b4b8 100644 --- a/arkoala/ets-plugin/.gitlab-ci.yml +++ b/arkoala/ets-plugin/.gitlab-ci.yml @@ -45,6 +45,7 @@ test ets-plugin (arkoala): - build compat - build common - build ets-plugin + - build harness test ets-plugin (arkts): stage: test @@ -61,6 +62,7 @@ test ets-plugin (arkts): - build compat - build common - build ets-plugin + - build harness test ets-plugin (koala): stage: test @@ -77,6 +79,7 @@ test ets-plugin (koala): - build compat - build common - build ets-plugin + - build harness test ets-plugin (arkoala spec): stage: test @@ -94,6 +97,7 @@ test ets-plugin (arkoala spec): - build compat - build common - build ets-plugin + - build harness test ets-plugin (arkts spec): stage: test @@ -111,6 +115,7 @@ test ets-plugin (arkts spec): - build compat - build common - build ets-plugin + - build harness test ets-plugin (koala spec): stage: test @@ -128,6 +133,7 @@ test ets-plugin (koala spec): - build compat - build common - build ets-plugin + - build harness pack ets-plugin: extends: diff --git a/arkoala/ets-plugin/package.json b/arkoala/ets-plugin/package.json index 229020c03..743b33c8f 100644 --- a/arkoala/ets-plugin/package.json +++ b/arkoala/ets-plugin/package.json @@ -40,14 +40,13 @@ "clean": "rimraf build test/spec test/specification/ets2bundle" }, "keywords": [], - "dependencies": {}, + "dependencies": { + "@koalaui/harness": "1.5.2+devel" + }, "devDependencies": { "@koalaui/ets-tsc": "4.9.5-r4", - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", "mocha": "^9.2.2", diff --git a/arkoala/ets-plugin/test/rewrites.test.ts b/arkoala/ets-plugin/test/rewrites.test.ts index 42b6978a4..6a0a433dc 100644 --- a/arkoala/ets-plugin/test/rewrites.test.ts +++ b/arkoala/ets-plugin/test/rewrites.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,6 +13,7 @@ * limitations under the License. */ +import { suite, test } from "@koalaui/harness" import { assertGeneratedEqualsGolden, testFolder } from "./utils" suite("Basic rewrites of ArkUI syntactic features", () => { diff --git a/arkoala/ets-plugin/test/specification/specification.test.ts b/arkoala/ets-plugin/test/specification/specification.test.ts index ab0ba5ec5..fd23a8e6b 100644 --- a/arkoala/ets-plugin/test/specification/specification.test.ts +++ b/arkoala/ets-plugin/test/specification/specification.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,6 +13,7 @@ * limitations under the License. */ +import { suite } from "@koalaui/harness" import { directoriesManager, testsForDirectories } from "../utils"; suite("ArkUI specification", () => { diff --git a/arkoala/ets-plugin/test/utils.ts b/arkoala/ets-plugin/test/utils.ts index aba4f32aa..336f63639 100644 --- a/arkoala/ets-plugin/test/utils.ts +++ b/arkoala/ets-plugin/test/utils.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -15,7 +15,7 @@ import * as path from 'path' import * as fs from 'fs' -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import * as child from "child_process" export function testFolder(folder: string) { -- Gitee From 1b67c6ded3f86e038658701ae7917dbb7a8a6fa4 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 14 Feb 2025 19:36:29 +0300 Subject: [PATCH 4/9] get rid of 'chai' in compiler-plugin tests Signed-off-by: Sergey Malenkov --- arkoala/ets-plugin/.gitlab-ci.yml | 2 +- incremental/compiler-plugin/.gitlab-ci.yml | 3 ++- incremental/compiler-plugin/package.json | 6 ++---- incremental/compiler-plugin/test/auto_detect.test.ts | 4 ++-- incremental/compiler-plugin/test/basic.test.ts | 4 ++-- .../compiler-plugin/test/diagnostics/diagnostics.test.ts | 4 ++-- incremental/compiler-plugin/test/function_return.test.ts | 4 ++-- incremental/compiler-plugin/test/parenthesised-call.test.ts | 4 ++-- incremental/compiler-plugin/test/util.test.ts | 4 ++-- .../compiler-plugin/test/variable_declaration.test.ts | 4 ++-- incremental/compiler-plugin/test/whole_file.test.ts | 4 ++-- .../compiler-plugin/test/wrap_object_literal.test.ts | 4 ++-- 12 files changed, 23 insertions(+), 24 deletions(-) diff --git a/arkoala/ets-plugin/.gitlab-ci.yml b/arkoala/ets-plugin/.gitlab-ci.yml index 2f526b4b8..b23b44b2c 100644 --- a/arkoala/ets-plugin/.gitlab-ci.yml +++ b/arkoala/ets-plugin/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 diff --git a/incremental/compiler-plugin/.gitlab-ci.yml b/incremental/compiler-plugin/.gitlab-ci.yml index 415b70528..84bf44371 100644 --- a/incremental/compiler-plugin/.gitlab-ci.yml +++ b/incremental/compiler-plugin/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 @@ -49,6 +49,7 @@ test compiler-plugin: - build compat - build common - build compiler-plugin + - build harness pack compiler-plugin: extends: diff --git a/incremental/compiler-plugin/package.json b/incremental/compiler-plugin/package.json index dccd66d64..cdba60bf8 100644 --- a/incremental/compiler-plugin/package.json +++ b/incremental/compiler-plugin/package.json @@ -10,14 +10,12 @@ ], "keywords": [], "dependencies": { - "@koalaui/common": "1.5.4+devel" + "@koalaui/common": "1.5.4+devel", + "@koalaui/harness": "1.5.4+devel" }, "devDependencies": { - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", "mocha": "^9.2.2", diff --git a/incremental/compiler-plugin/test/auto_detect.test.ts b/incremental/compiler-plugin/test/auto_detect.test.ts index ea6993fa6..e1dea4fd1 100644 --- a/incremental/compiler-plugin/test/auto_detect.test.ts +++ b/incremental/compiler-plugin/test/auto_detect.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,9 +13,9 @@ * limitations under the License. */ +import { Assert as assert, suite, test } from "@koalaui/harness" import { Context } from "./context.test" import { log, getLogFiltered, resetLog } from "./util.test" -import { assert } from "chai" const someId = "xxx" diff --git a/incremental/compiler-plugin/test/basic.test.ts b/incremental/compiler-plugin/test/basic.test.ts index 26d9b039a..f701ccffd 100644 --- a/incremental/compiler-plugin/test/basic.test.ts +++ b/incremental/compiler-plugin/test/basic.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,13 +13,13 @@ * limitations under the License. */ +import { Assert as assert, suite, test } from "@koalaui/harness" import { qox, til, zex as wax, accessId, juv, Zan, ryq, bae } from "./module.test" import { exported } from "./exports.test" import defexport from "./default-export.test" import { E } from "./export-as.test" import { __id, Context } from "./context.test" import { log, getLogFiltered, resetLog, cleanDumpDirectory, checkDump } from "./util.test" -import { assert } from "chai" const someId = "xxx" diff --git a/incremental/compiler-plugin/test/diagnostics/diagnostics.test.ts b/incremental/compiler-plugin/test/diagnostics/diagnostics.test.ts index f7bf8a981..7895b1b60 100644 --- a/incremental/compiler-plugin/test/diagnostics/diagnostics.test.ts +++ b/incremental/compiler-plugin/test/diagnostics/diagnostics.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import { assert } from "chai" +import { Assert as assert, suite, test } from "@koalaui/harness" import * as child from "child_process" import * as path from "path" diff --git a/incremental/compiler-plugin/test/function_return.test.ts b/incremental/compiler-plugin/test/function_return.test.ts index 69b219597..575ebcd99 100644 --- a/incremental/compiler-plugin/test/function_return.test.ts +++ b/incremental/compiler-plugin/test/function_return.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,8 +13,8 @@ * limitations under the License. */ +import { Assert as assert, suite, test } from "@koalaui/harness" import { Context } from "./context.test" -import { assert } from "chai" const someId = "xxx" diff --git a/incremental/compiler-plugin/test/parenthesised-call.test.ts b/incremental/compiler-plugin/test/parenthesised-call.test.ts index ec35ac296..2b6daae77 100644 --- a/incremental/compiler-plugin/test/parenthesised-call.test.ts +++ b/incremental/compiler-plugin/test/parenthesised-call.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,9 +13,9 @@ * limitations under the License. */ +import { suite, test } from "@koalaui/harness" // import { Context } from "./context.test" import { checkDump } from "./util.test" -// import { assert } from "chai" // const someId: string = "xxx" diff --git a/incremental/compiler-plugin/test/util.test.ts b/incremental/compiler-plugin/test/util.test.ts index d0f1f469c..46d738546 100644 --- a/incremental/compiler-plugin/test/util.test.ts +++ b/incremental/compiler-plugin/test/util.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,9 +13,9 @@ * limitations under the License. */ +import { Assert as assert, test } from "@koalaui/harness" import * as path from "path" import * as fs from "fs" -import { assert } from "chai" let logText: string = "" diff --git a/incremental/compiler-plugin/test/variable_declaration.test.ts b/incremental/compiler-plugin/test/variable_declaration.test.ts index c97d223bd..f352d644a 100644 --- a/incremental/compiler-plugin/test/variable_declaration.test.ts +++ b/incremental/compiler-plugin/test/variable_declaration.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,9 +13,9 @@ * limitations under the License. */ +import { Assert as assert, suite, test } from "@koalaui/harness" import { Context } from "./context.test" import { checkDump } from "./util.test" -import { assert } from "chai" const someId = "xxx" diff --git a/incremental/compiler-plugin/test/whole_file.test.ts b/incremental/compiler-plugin/test/whole_file.test.ts index fe813a0e1..56d9801c0 100644 --- a/incremental/compiler-plugin/test/whole_file.test.ts +++ b/incremental/compiler-plugin/test/whole_file.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,8 +13,8 @@ * limitations under the License. */ +import { Assert as assert, suite, test } from "@koalaui/harness" import * as fs from "fs" -import { assert } from "chai" function assertUnmemoizedEqualGolden(filename: string) { const unmemoized = fs.readFileSync(`./test/unmemoized/${filename}`, "utf8"); diff --git a/incremental/compiler-plugin/test/wrap_object_literal.test.ts b/incremental/compiler-plugin/test/wrap_object_literal.test.ts index 24ea67b2d..3e6b54e47 100644 --- a/incremental/compiler-plugin/test/wrap_object_literal.test.ts +++ b/incremental/compiler-plugin/test/wrap_object_literal.test.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -13,9 +13,9 @@ * limitations under the License. */ +import { Assert as assert, suite, test } from "@koalaui/harness" import { Context } from "./context.test" import { checkDump } from "./util.test" -import { assert } from "chai" const someId = "xxx" -- Gitee From 4d1e173732f99289c6fbb0edec3f2f3efa1a4f5c Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 17 Feb 2025 13:03:41 +0300 Subject: [PATCH 5/9] move test-util/register into harness Signed-off-by: Sergey Malenkov --- incremental/harness/js/register.js | 34 ++++++++++++++++++++++++++++++ incremental/harness/package.json | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 incremental/harness/js/register.js diff --git a/incremental/harness/js/register.js b/incremental/harness/js/register.js new file mode 100644 index 000000000..c87312c19 --- /dev/null +++ b/incremental/harness/js/register.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022-2025 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 { goldenSetup } from "./golden.js" + +const tsNode = require("ts-node") +const path = require("path") + +goldenSetup('.', '.') + +unmemoized_suffix = process.env.UNMEMOIZED_SUFFIX +if (unmemoized_suffix == undefined) { + unmemoized_suffix = '' +} + +tsNode.register({ + files: true, + // If uncommented, running tests doesn't perform type checks. + // transpileOnly: true, + project: path.resolve(`test`, `tsconfig${unmemoized_suffix}.json`), + compiler: "@koalaui/ets-tsc" +}) diff --git a/incremental/harness/package.json b/incremental/harness/package.json index fe784704c..c5abcd8ed 100644 --- a/incremental/harness/package.json +++ b/incremental/harness/package.json @@ -6,6 +6,7 @@ "types": "build/src/index.d.ts", "files": [ "js/golden.js", + "js/register.js", "build/src/**/*.js", "build/src/**/*.d.ts" ], @@ -20,6 +21,7 @@ }, "exports": { "./golden": "./js/golden.js", + "./register": "./js/register.js", ".": "./build/src/index.js" }, "scripts": { -- Gitee From 2643e0120dfd08e51a45877b789babb22a687a31 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 17 Feb 2025 16:21:02 +0300 Subject: [PATCH 6/9] resolve version after publishing Signed-off-by: Sergey Malenkov --- arkoala/ets-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkoala/ets-plugin/package.json b/arkoala/ets-plugin/package.json index 743b33c8f..a1bb605f5 100644 --- a/arkoala/ets-plugin/package.json +++ b/arkoala/ets-plugin/package.json @@ -41,7 +41,7 @@ }, "keywords": [], "dependencies": { - "@koalaui/harness": "1.5.2+devel" + "@koalaui/harness": "1.5.3+devel" }, "devDependencies": { "@koalaui/ets-tsc": "4.9.5-r4", -- Gitee From 565d62196eedaf0c1e6ebbb4c4c1771e59038715 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 17 Feb 2025 18:11:58 +0300 Subject: [PATCH 7/9] remove unused dependencies Signed-off-by: Sergey Malenkov --- arkoala/ets-plugin/oh-package.json5 | 3 --- incremental/compat/oh-package.json5 | 5 ----- incremental/compat/package.json | 5 ----- incremental/compiler-plugin/oh-package.json5 | 3 --- incremental/package.json | 2 -- interop/oh-package.json5 | 4 ---- interop/package.json | 4 ---- 7 files changed, 26 deletions(-) diff --git a/arkoala/ets-plugin/oh-package.json5 b/arkoala/ets-plugin/oh-package.json5 index 48b4bce36..17a0cd831 100644 --- a/arkoala/ets-plugin/oh-package.json5 +++ b/arkoala/ets-plugin/oh-package.json5 @@ -24,11 +24,8 @@ "keywords": [], "dependencies": {}, "devDependencies": { - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", "mocha": "^9.2.2", diff --git a/incremental/compat/oh-package.json5 b/incremental/compat/oh-package.json5 index 0a0d59e03..45b5a9768 100644 --- a/incremental/compat/oh-package.json5 +++ b/incremental/compat/oh-package.json5 @@ -20,15 +20,10 @@ "dependencies": { }, "devDependencies": { - "@ohos/hypium": "1.0.6", - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", - "mocha": "^9.2.2", "source-map-support": "^0.5.21" } } diff --git a/incremental/compat/package.json b/incremental/compat/package.json index 97ea035f5..22361f241 100644 --- a/incremental/compat/package.json +++ b/incremental/compat/package.json @@ -33,15 +33,10 @@ "keywords": [], "dependencies": {}, "devDependencies": { - "@ohos/hypium": "1.0.6", - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", - "mocha": "^9.2.2", "source-map-support": "^0.5.21" } } \ No newline at end of file diff --git a/incremental/compiler-plugin/oh-package.json5 b/incremental/compiler-plugin/oh-package.json5 index eaac79d1b..a3fd33cd5 100644 --- a/incremental/compiler-plugin/oh-package.json5 +++ b/incremental/compiler-plugin/oh-package.json5 @@ -13,11 +13,8 @@ "@koalaui/common": "1.4.1+devel" }, "devDependencies": { - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", "mocha": "^9.2.2", diff --git a/incremental/package.json b/incremental/package.json index 824bca843..edf017428 100644 --- a/incremental/package.json +++ b/incremental/package.json @@ -11,8 +11,6 @@ "compiler-plugin" ], "devDependencies": { - "@types/chai": "4.3.10", - "chai": "4.3.10", "ts-node": "^10.7.0", "ts-patch": "^2.1.0", "tslib": "^2.3.1", diff --git a/interop/oh-package.json5 b/interop/oh-package.json5 index 2db4af57c..96d62e6ba 100644 --- a/interop/oh-package.json5 +++ b/interop/oh-package.json5 @@ -49,14 +49,10 @@ "@koalaui/common": "1.4.1+devel" }, "devDependencies": { - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", - "mocha": "^9.2.2", "source-map-support": "^0.5.21" } } diff --git a/interop/package.json b/interop/package.json index cc1f72473..b6b67eae8 100644 --- a/interop/package.json +++ b/interop/package.json @@ -61,15 +61,11 @@ }, "devDependencies": { "@ohos/hypium": "1.0.6", - "@types/chai": "^4.3.1", "@types/node": "^18.0.0", - "@types/mocha": "^9.1.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", "eslint": "^8.13.0", "eslint-plugin-unused-imports": "^2.0.0", - "mocha": "^9.2.2", "source-map-support": "^0.5.21", "@koalaui/ets-tsc": "4.9.5-r4", "@koalaui/fast-arktsc": "next" -- Gitee From b60f7ec7d80ecbaeaefe62cead5e519c50ec650b Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Wed, 19 Feb 2025 16:54:36 +0300 Subject: [PATCH 8/9] try to fix ets-plugin testing Signed-off-by: Sergey Malenkov --- arkoala/ets-plugin/test/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkoala/ets-plugin/test/utils.ts b/arkoala/ets-plugin/test/utils.ts index 336f63639..f278a6741 100644 --- a/arkoala/ets-plugin/test/utils.ts +++ b/arkoala/ets-plugin/test/utils.ts @@ -15,7 +15,7 @@ import * as path from 'path' import * as fs from 'fs' -import { Assert as assert, suite, test } from "@koalaui/harness" +import { Assert as assert } from "@koalaui/harness" import * as child from "child_process" export function testFolder(folder: string) { -- Gitee From cd1576a3d2260b68214a1fb555078468b6d30ee0 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Wed, 19 Feb 2025 16:55:01 +0300 Subject: [PATCH 9/9] resolve version after publishing Signed-off-by: Sergey Malenkov --- arkoala/ets-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkoala/ets-plugin/package.json b/arkoala/ets-plugin/package.json index a1bb605f5..449497d3f 100644 --- a/arkoala/ets-plugin/package.json +++ b/arkoala/ets-plugin/package.json @@ -41,7 +41,7 @@ }, "keywords": [], "dependencies": { - "@koalaui/harness": "1.5.3+devel" + "@koalaui/harness": "1.5.4+devel" }, "devDependencies": { "@koalaui/ets-tsc": "4.9.5-r4", -- Gitee