diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js index c852fc8f3f4689548b21f0b48e75ac6ee2324d81..bb58dd46c998e6d8d351b19505e881d4fb79afa3 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js @@ -1031,6 +1031,7 @@ describe('ActsFeatureAbilityTest', function () { console.info("ACTS_GetAppType_0100 getAppType info :" + JSON.stringify(data)) checkAppType(data); console.info('====> ACTS_GetAppType_0100 end=====>') + done() }).catch((err)=>{ console.info('====> ACTS_GetAppType_0100 err=====>' + JSON.stringify(err)) expect().assertFail() @@ -1152,23 +1153,19 @@ describe('ActsFeatureAbilityTest', function () { * @tc.desc: Check the return value of the interface (by AsyncCallback) */ it('ACTS_GetAbilityInfo_0200', 0, async function (done) { - let tempInfo; featureAbility.getContext().getAbilityInfo( (err, data) => { if(err.code != 0){ expect().assertFail() done() }else{ - tempInfo = data + console.info('====> ACTS_GetAbilityInfo_0200 =====>' + JSON.stringify(data)) + checkAbilityInfo(data); + done() } } ); - setTimeout(function () { - console.info('====> ACTS_GetAbilityInfo_0200 =====>' + JSON.stringify(tempInfo)) - checkAbilityInfo(tempInfo); - console.info('====> ACTS_GetAbilityInfo_0200 =====>') - done() - }, TIMEOUT) + await sleep(1000) }) // checkHapModuleInfo