From 43047dff0781c4327869ed77e0a622cefa1bd11a Mon Sep 17 00:00:00 2001 From: yanglifeng1217 Date: Wed, 14 Sep 2022 11:16:35 +0800 Subject: [PATCH] Signed-off-by: yanglifeng1217 --- .../hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js | 2 +- .../hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js | 4 ++-- .../hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js | 2 +- .../hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js index 66d4db197..ed32450ff 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js @@ -1801,7 +1801,7 @@ describe('deviceKvStoreCallbackTest', function () { await kvStore.removeDeviceData('', function (err,data) { if (err == undefined) { console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData success'); - expect(null).assertFail(); + expect(err == undefined).assertTrue(); } else { console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData fail'); } diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js index dccb08d87..239aa54f7 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js @@ -1990,11 +1990,11 @@ describe('deviceKvStorePromiseTest', function () { it('testDeviceKvStoreRemoveDeviceData003', 0, async function (done) { console.info('testDeviceKvStoreRemoveDeviceData003'); try { - await kvStore.removeDeviceData('').then((err) => { + await kvStore.removeDeviceData('').then(() => { console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData success'); - expect(null).assertFail(); }).catch((err) => { console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData fail ' + err); + expect(null).assertFail(); }); }catch(e) { console.info('testDeviceKvStoreRemoveDeviceData003 e ' + e); diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js index 792701fc1..3001a4268 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js @@ -1760,7 +1760,7 @@ describe('singleKvStoreCallbackTest', function () { await kvStore.removeDeviceData('', function (err,data) { if (err == undefined) { console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData success'); - expect(null).assertFail(); + expect(err == undefined).assertTrue(); } else { console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData fail'); } diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js index 15bcefc7a..9e4f302e9 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js @@ -1959,11 +1959,11 @@ describe('singleKvStorePromiseTest', function () { it('testSingleKvStoreRemoveDeviceData003', 0, async function (done) { console.info('testSingleKvStoreRemoveDeviceData003'); try { - await kvStore.removeDeviceData('').then((err) => { + await kvStore.removeDeviceData('').then(() => { console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData success'); - expect(null).assertFail(); }).catch((err) => { console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData fail ' + err); + expect(null).assertFail(); }); }catch(e) { console.info('testSingleKvStoreRemoveDeviceData003 e ' + e); -- GitLab