未验证 提交 800e2506 编写于 作者: O openharmony_ci 提交者: Gitee

!8089 【resourceschedule_standard】【master】master延迟任务用例修改

Merge pull request !8089 from smartltt/master_0320
...@@ -421,15 +421,13 @@ describe("WorkSchedulerJsTest", function () { ...@@ -421,15 +421,13 @@ describe("WorkSchedulerJsTest", function () {
console.info('----------------------WorkSchedulerJsTest014---------------------------'); console.info('----------------------WorkSchedulerJsTest014---------------------------');
workScheduler.isLastWorkTimeOut(14, (err, res) =>{ workScheduler.isLastWorkTimeOut(14, (err, res) =>{
if (err) { if (err) {
expect(false).assertEqual(true) console.info('WorkSchedulerJsTest014 isLastWorkTimeOut callback failed, err:' + err.code);
expect(err.code).assertEqual(9700004);
done();
} else { } else {
console.info('WorkSchedulerJsTest014 isLastWorkTimeOut callback success, data is:' + res); console.info('WorkSchedulerJsTest014 isLastWorkTimeOut callback success, data is:' + res);
expect(true).assertEqual(true)
} }
}); });
setTimeout(()=>{
done();
}, 500);
}) })
/* /*
...@@ -442,14 +440,12 @@ describe("WorkSchedulerJsTest", function () { ...@@ -442,14 +440,12 @@ describe("WorkSchedulerJsTest", function () {
workScheduler.isLastWorkTimeOut(15) workScheduler.isLastWorkTimeOut(15)
.then(res => { .then(res => {
console.info('WorkSchedulerJsTest015 isLastWorkTimeOut promise success, data is:' + res); console.info('WorkSchedulerJsTest015 isLastWorkTimeOut promise success, data is:' + res);
expect(true).assertEqual(true)
}) })
.catch(err => { .catch(err => {
expect(false).assertEqual(true) console.info('WorkSchedulerJsTest015 isLastWorkTimeOut promise failed, err:' + err.code);
expect(err.code).assertEqual(9700004);
done();
}); });
setTimeout(()=>{
done();
}, 500);
}) })
/* /*
......
...@@ -1992,15 +1992,12 @@ export default function WorkSchedulerMgrApiTest() { ...@@ -1992,15 +1992,12 @@ export default function WorkSchedulerMgrApiTest() {
workScheduler.isLastWorkTimeOut(-1, (error, res) =>{ workScheduler.isLastWorkTimeOut(-1, (error, res) =>{
if (error) { if (error) {
console.info('testIsLastWorkTimeOutFun001 isLastWorkTimeOut callback fail, because:' + error.code); console.info('testIsLastWorkTimeOutFun001 isLastWorkTimeOut callback fail, because:' + error.code);
expect(error.code).assertLarger(0) expect(error.code).assertEqual(9700004);
done();
} else { } else {
console.info('testIsLastWorkTimeOutFun001 isLastWorkTimeOut callback success, data is:' + res); console.info('testIsLastWorkTimeOutFun001 isLastWorkTimeOut callback success, data is:' + res);
expect(res).assertInstanceOf('Boolean')
} }
}); });
setTimeout(()=>{
done();
}, 500);
}) })
/* /*
...@@ -2013,18 +2010,15 @@ export default function WorkSchedulerMgrApiTest() { ...@@ -2013,18 +2010,15 @@ export default function WorkSchedulerMgrApiTest() {
try{ try{
workScheduler.isLastWorkTimeOut('1').then(res => { workScheduler.isLastWorkTimeOut('1').then(res => {
console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise success, data is:' + res); console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise success, data is:' + res);
expect(res).assertInstanceOf('Boolean')
}) })
.catch(error => { .catch(error => {
console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise fail, because:' + error.code); console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise fail, because:' + error.code);
expect(error.code).assertLarger(0)
}); });
}catch(error){ }catch(error){
console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise fail ,' + error); console.info('testIsLastWorkTimeOutFun003 isLastWorkTimeOut promise fail ,' + error);
} expect(error.code).assertEqual('401');
setTimeout(()=>{
done(); done();
}, 500); }
}) })
/*testStartWorkFun020 /*testStartWorkFun020
...@@ -2037,18 +2031,15 @@ export default function WorkSchedulerMgrApiTest() { ...@@ -2037,18 +2031,15 @@ export default function WorkSchedulerMgrApiTest() {
try{ try{
workScheduler.isLastWorkTimeOut(null).then(res => { workScheduler.isLastWorkTimeOut(null).then(res => {
console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise success, data is:' + res); console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise success, data is:' + res);
expect(res).assertInstanceOf('Boolean')
}) })
.catch(error => { .catch(error => {
console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise fail, because:' + error.code); console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise fail, because:' + error.code);
expect(error.code).assertLarger(0)
}); });
}catch(error){ }catch(error){
console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise fail ,' + error); console.info('testIsLastWorkTimeOutFun004 isLastWorkTimeOut promise fail ,' + error);
} expect(error.code).assertEqual('401');
setTimeout(()=>{
done(); done();
}, 500); }
}) })
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册