diff --git a/account/OsAccountTest_js/src/main/js/default/test/OsAccount.test.js b/account/OsAccountTest_js/src/main/js/default/test/OsAccount.test.js index 33e0cfe8c657f1530c96d36e2dee44a97ab916d4..c2c7cd0729499c8a94ed7aa9ba218769d735acae 100755 --- a/account/OsAccountTest_js/src/main/js/default/test/OsAccount.test.js +++ b/account/OsAccountTest_js/src/main/js/default/test/OsAccount.test.js @@ -67,13 +67,12 @@ describe('AccountTest', function () { */ it('account_updateOsAccountDistributedInfo_test001', 0, function () { const accountAbility = account.getDistributedAccountAbility() + let data = null let obj = { id: '12345', name: 'ZhangSan', - event: 'Ohos.account.event.LOGIN' - scalableData={ - testInfo:"Test" - } + event: 'Ohos.account.event.LOGIN', + scalableData:data }; accountAbility.updateOsAccountDistributedInfo(obj).then(function (result) { expect(result).assertTrue() @@ -90,9 +89,9 @@ describe('AccountTest', function () { }); }); }); - accountAbility.queryOsAccountDistributedInfo(function (data)) { + accountAbility.queryOsAccountDistributedInfo(function (data) { execpt(data).assertNull() - } + }) }) /** @@ -101,14 +100,13 @@ describe('AccountTest', function () { * @tc.desc Test distributedAccount.updateOsAccountDistributedInfo API functionality by callback. */ it('account_updateOsAccountDistributedInfo_test002', 0, function () { + let data = null const accountAbility = account.getDistributedAccountAbility() let obj = { id: '12345', name: 'ZhangSan', - event: 'Ohos.account.event.LOGIN' - scalableData={ - testInfo:"Test" - } + event: 'Ohos.account.event.LOGIN', + scalableData:data }; accountAbility.updateOsAccountDistributedInfo(obj, function (result) { expect(result).assertTrue() @@ -136,19 +134,18 @@ describe('AccountTest', function () { */ it('account_updateOsAccountDistributedInfo_test003', 0, function () { const accountAbility = account.getDistributedAccountAbility() + let data = null let obj = { id: '12345', name: 'ZhangSan', - event: 'Ohos.account.event.TOKEN_INVALID' - scalableData={ - testInfo:"Test" - } + event: 'Ohos.account.event.TOKEN_INVALID', + scalableData:data }; accountAbility.updateOsAccountDistributedInfo(obj, function (result) { expect(result).assertTrue() - accountAbility.queryOsAccountDistributedInfo(obj).then(function (data)) { + accountAbility.queryOsAccountDistributedInfo(obj).then(function (data) { except(data.name).assertNull() - } + }) }); }) @@ -159,13 +156,12 @@ describe('AccountTest', function () { */ it('account_updateOsAccountDistributedInfo_test004', 0, function () { const accountAbility = account.getDistributedAccountAbility() + let data = null let obj = { id: '12345', name: 'ZhangSan', - event: 'Ohos.account.event.LOGIN' - scalableData={ - testInfo:"Test" - } + event: 'Ohos.account.event.LOGIN', + scalableData:data }; accountAbility.updateOsAccountDistributedInfo(obj, function (result) { expect(result).assertTrue() @@ -185,4 +181,4 @@ describe('AccountTest', function () { }); }); }) -}) \ No newline at end of file +}) diff --git a/miscservices/TimeTest_js/src/main/js/default/test/Time.test.js b/miscservices/TimeTest_js/src/main/js/default/test/Time.test.js index 10e83453a9f0e4d9931f60f592a2b7c233d42653..e351bbce86bcb36be4d48fc4ff323ac664774739 100755 --- a/miscservices/TimeTest_js/src/main/js/default/test/Time.test.js +++ b/miscservices/TimeTest_js/src/main/js/default/test/Time.test.js @@ -98,10 +98,10 @@ describe('TimeTest', function() { systemTime.setTime(-1, (error, data) => { console.log("setTime ===data: " + data); console.log("setTime ===error: " + error); - })catch(error=> { + }).catch(error=> { execpt(0).assertLarger(1) }) console.log('SUB_systemTime_setTime_JS_API_0400 end'); done() }) -}) \ No newline at end of file +})