From f82c6945f5c2616be2194acdafb7f1077e92943f Mon Sep 17 00:00:00 2001 From: smartltt Date: Mon, 20 Mar 2023 15:03:06 +0800 Subject: [PATCH] =?UTF-8?q?master=E5=BB=B6=E8=BF=9F=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: smartltt Change-Id: I0b9a8a12578ea72ae1411ba6a25d6161e46ef083 --- .../src/main/js/test/WorkScheduler.test.js | 16 ++++++-------- .../main/js/test/WorkSchedulerMgrJs.test.js | 21 ++++++------------- 2 files changed, 12 insertions(+), 25 deletions(-) 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 8a0bdbfb0..b4ce77c80 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 76f354a16..4a04bca2d 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); + } }) }) } -- GitLab