From a649c8051c3c6fba9af6ad822dfdb32368560cef Mon Sep 17 00:00:00 2001 From: nan-xiansen Date: Tue, 15 Feb 2022 16:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=A8=E5=B1=80=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E5=AD=90=E7=B3=BB=E7=BB=9F=E3=80=91=E3=80=90?= =?UTF-8?q?mater=E3=80=91=E4=BF=AE=E5=A4=8D=E6=8F=90=E9=86=92=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E5=A4=B1=E8=B4=A5=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nan-xiansen Change-Id: I27fd4c358a46e7a0660b70d6b4aa0d3e8e69ad18 --- .../js/default/test/ReminderAgentJs.test.js | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js b/resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js index 7b33cebc8..5399ec6e7 100644 --- a/resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js +++ b/resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js @@ -126,24 +126,25 @@ describe('ReminderAgentTest', function () { * @tc.name testAddNotificationSlotNorFun002 * @tc.desc Adds a reminder notification slot with the promise function and null mySlot. */ - it('testAddNotificationSlotNorFun002', 0, async function (done) { - let mySlot = null; - let promise = new Promise((resolve, reject) => { - reminderAgent.addNotificationSlot(mySlot).then(() => { - resolve(); - }).catch(function (err) { - reject(new Error('errr occurred.')); - console.info('error: ' + err.code); - } - ); - promise.then(() => { - }, err => { - let i = 0; - expect(0).assertEqual(i); - }).catch(res => { }); + it('testAddNotificationSlotNorFun002', 0, async function (done) { + let mySlot = null; + try { + reminderAgent.addNotificationSlot(mySlot,function(err) { + if(err == undefined) { + console.info('testAddNotificationSlotNorFun002 execute success'); + } else { + console.info('testAddNotificationSlotNorFun002 execute failed'); + } + }).catch(function(err) { + console.info("testAddNotificationSlotNorFun002 execute catch" + err.code); + }) + } catch(error) { + console.info("testAddNotificationSlotNorFun002 execute try - catch" + error.code); + let i = 0; + expect(0).assertEqual(i); done(); - }) - + }}) + /** * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_005 * @tc.name testAddNotificationSlotNorFun003 @@ -630,4 +631,4 @@ describe('ReminderAgentTest', function () { done(); }) }) -}) + -- GitLab