diff --git a/resourceschedule/resourceschedule_standard/workscheduler/src/main/js/test/WorkScheduler.test.js b/resourceschedule/resourceschedule_standard/workscheduler/src/main/js/test/WorkScheduler.test.js index 8a0bdbfb0c038182457afc61c540950ae9c6a4f3..b4ce77c80d97f14d3f75dbc6a88a5cbc940480a4 100644 --- a/resourceschedule/resourceschedule_standard/workscheduler/src/main/js/test/WorkScheduler.test.js +++ b/resourceschedule/resourceschedule_standard/workscheduler/src/main/js/test/WorkScheduler.test.js @@ -421,15 +421,13 @@ describe("WorkSchedulerJsTest", function () { console.info('----------------------WorkSchedulerJsTest014---------------------------'); workScheduler.isLastWorkTimeOut(14, (err, res) =>{ if (err) { - expect(false).assertEqual(true) + console.info('WorkSchedulerJsTest014 isLastWorkTimeOut callback failed, err:' + err.code); + expect(err.code).assertEqual(9700004); + done(); } else { console.info('WorkSchedulerJsTest014 isLastWorkTimeOut callback success, data is:' + res); - expect(true).assertEqual(true) } }); - setTimeout(()=>{ - done(); - }, 500); }) /* @@ -442,14 +440,12 @@ describe("WorkSchedulerJsTest", function () { workScheduler.isLastWorkTimeOut(15) .then(res => { console.info('WorkSchedulerJsTest015 isLastWorkTimeOut promise success, data is:' + res); - expect(true).assertEqual(true) }) .catch(err => { - expect(false).assertEqual(true) + console.info('WorkSchedulerJsTest015 isLastWorkTimeOut promise failed, err:' + err.code); + expect(err.code).assertEqual(9700004); + done(); }); - setTimeout(()=>{ - done(); - }, 500); }) /* diff --git a/resourceschedule/resourceschedule_standard/workscheduler/src/main/js/test/WorkSchedulerMgrJs.test.js b/resourceschedule/resourceschedule_standard/workscheduler/src/main/js/test/WorkSchedulerMgrJs.test.js index 76f354a16b61280f12ffc8723d5e85afd1704c93..4a04bca2d616a2a781e675a7c641afce3fee3b8c 100644 --- a/resourceschedule/resourceschedule_standard/workscheduler/src/main/js/test/WorkSchedulerMgrJs.test.js +++ b/resourceschedule/resourceschedule_standard/workscheduler/src/main/js/test/WorkSchedulerMgrJs.test.js @@ -1992,15 +1992,12 @@ export default function WorkSchedulerMgrApiTest() { workScheduler.isLastWorkTimeOut(-1, (error, res) =>{ if (error) { console.info('testIsLastWorkTimeOutFun001 isLastWorkTimeOut callback fail, because:' + error.code); - expect(error.code).assertLarger(0) + expect(error.code).assertEqual(9700004); + done(); } else { console.info('testIsLastWorkTimeOutFun001 isLastWorkTimeOut callback success, data is:' + res); - expect(res).assertInstanceOf('Boolean') } }); - setTimeout(()=>{ - done(); - }, 500); }) /* @@ -2013,18 +2010,15 @@ export default function WorkSchedulerMgrApiTest() { try{ workScheduler.isLastWorkTimeOut('1').then(res => { console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise success, data is:' + res); - expect(res).assertInstanceOf('Boolean') }) .catch(error => { console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise fail, because:' + error.code); - expect(error.code).assertLarger(0) }); }catch(error){ console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise fail ,' + error); - } - setTimeout(()=>{ + expect(error.code).assertEqual('401'); done(); - }, 500); + } }) /*testStartWorkFun020 @@ -2037,18 +2031,15 @@ export default function WorkSchedulerMgrApiTest() { try{ workScheduler.isLastWorkTimeOut(null).then(res => { console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise success, data is:' + res); - expect(res).assertInstanceOf('Boolean') }) .catch(error => { console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise fail, because:' + error.code); - expect(error.code).assertLarger(0) }); }catch(error){ console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise fail ,' + error); - } - setTimeout(()=>{ + expect(error.code).assertEqual('401'); done(); - }, 500); + } }) }) }