提交 2eeb582b 编写于 作者: L lyj_love_code

adapt hiappevent test case

Signed-off-by: Nlyj_love_code <liangyujian2@huawei.com>
上级 c3f26558
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-2022 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
......@@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import HiAppEventV9 from '@ohos.hiviewdfx.hiAppEvent'
import HiAppEvent from '@ohos.hiAppEvent'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import Constant from 'deccjsunit/src/Constant'
......@@ -434,11 +435,11 @@ describe('HiAppEventApiTest', function () {
console.log('HiAppEvent into json-callback');
if (err) {
console.error(`HiAppEvent json-callback-error code=${err.code}`);
expect().assertFail();
expect(err.code).assertEqual(-2);
done();
} else {
console.log(`HiAppEvent json-callback-success value=${value}`);
expect(value == 0).assertTrue();
expect().assertFail();
done();
}
});
......@@ -586,10 +587,10 @@ describe('HiAppEventApiTest', function () {
*/
it('testHiAppEventApi26', 2, async function (done) {
console.info('testHiAppEventApi26 start')
HiAppEvent.write({
HiAppEventV9.write({
domain: "test_domain",
name: "write",
eventType: HiAppEvent.EventType.FAULT,
eventType: HiAppEventV9.EventType.FAULT,
params: {
"key_int": 100, "key_string": "demo",
"key_bool":true, "key_float":1.1,"key_array_int": [1, 2, 3], "key_array_float": [1.1, 2.2, 3.3],
......@@ -612,10 +613,10 @@ describe('HiAppEventApiTest', function () {
*/
it('testHiAppEventApi27', 2, async function (done) {
console.info('testHiAppEventApi27 start')
HiAppEvent.write({
HiAppEventV9.write({
domain: "test_domain",
name: "test_event",
eventType: HiAppEvent.EventType.FAULT,
eventType: HiAppEventV9.EventType.FAULT,
params: {
"key_int": 100, "key_string": "demo",
"key_bool":true, "key_float":1.1,"key_array_int": [1, 2, 3], "key_array_float": [1.1, 2.2, 3.3],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册