From 891aee3bf29f6f1e71f6a4c65a0a0049414bb8c1 Mon Sep 17 00:00:00 2001 From: wuxiaodan Date: Mon, 30 Jan 2023 14:51:22 +0800 Subject: [PATCH] update acts testcase Signed-off-by: wuxiaodan --- .../js/test/SingleKvStoreKVCallbackJsTest.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js index debd83af1..3028c44fc 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js @@ -177,9 +177,10 @@ describe('SingleKvStoreCallbackTest', function () { await kvStore.get(KEY_TEST_STRING_ELEMENT, function (err,data) { if (err == undefined) { console.info('SingleKvStoreGetStringCallbackTest001 get success'); - expect(true).assertTrue(); + expect(null).assertFail(); } else { - console.info('SingleKvStoreGetStringCallbackTest001 get fail'); + console.error('SingleKvStoreGetStringCallbackTest001 get fail' + `, error code is ${err.code}, message is ${err.message}`); + expect(err.code == 15100004).assertTrue(); } done(); }); @@ -355,9 +356,10 @@ describe('SingleKvStoreCallbackTest', function () { await kvStore.get(KEY_TEST_INT_ELEMENT, function (err,data) { if (err == undefined) { console.info('SingleKvStoreGetIntCallbackTest002 get success'); - expect(true).assertTrue(); + expect(null).assertFail(); } else { - console.info('SingleKvStoreGetIntCallbackTest002 get fail'); + console.error('SingleKvStoreGetIntCallbackTest002 get fail' + `, error code is ${err.code}, message is ${err.message}`); + expect(err.code == 15100004).assertTrue(); } done(); }) @@ -401,9 +403,10 @@ describe('SingleKvStoreCallbackTest', function () { await kvStore.get(KEY_TEST_BOOLEAN_ELEMENT, function (err,data) { if (err == undefined) { console.info('SingleKvStoreGetBoolCallbackTest001 get success'); - expect(true).assertTrue(); + expect(null).assertFail(); } else { console.error('SingleKvStoreGetBoolCallbackTest001 get fail' + `, error code is ${err.code}, message is ${err.message}`); + expect(err.code == 15100004).assertTrue(); } done(); }); @@ -553,9 +556,10 @@ describe('SingleKvStoreCallbackTest', function () { await kvStore.get(KEY_TEST_FLOAT_ELEMENT, function (err,data) { if (err == undefined) { console.info('SingleKvStoreGetFloatCallbackTest001 get success'); - expect(true).assertTrue(); + expect(null).assertFail(); } else { console.error('SingleKvStoreGetFloatCallbackTest001 get fail' + `, error code is ${err.code}, message is ${err.message}`); + expect(err.code == 15100004).assertTrue(); } done(); }); -- GitLab