From b70fc2f485eec0cfa0cd51ec4f721b216be54bf5 Mon Sep 17 00:00:00 2001 From: zhijianwen Date: Mon, 22 Aug 2022 17:07:43 +0800 Subject: [PATCH] finishCommonEvent Signed-off-by: zhijianwen --- .../js/test/ActsSubscriber_test_ordered.js | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/src/main/js/test/ActsSubscriber_test_ordered.js b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/src/main/js/test/ActsSubscriber_test_ordered.js index 5f969d4c6..ffdd1180e 100644 --- a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/src/main/js/test/ActsSubscriber_test_ordered.js +++ b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/src/main/js/test/ActsSubscriber_test_ordered.js @@ -477,9 +477,14 @@ describe('ActsSubscriberTestOrder', function () { expect(data.event).assertEqual('publish_event0500'); expect(data.code).assertEqual(10); expect(data.data).assertEqual('publish_event0500_init'); - commonEventSubscriber0500.finishCommonEvent().then(() => { - console.info('===============>subscriberCallBack0500 finishCommonEvent promise'); - }); + commonEventSubscriber0500.finishCommonEvent((err) => { + if (err.code) { + console.info("===============>finishCommonEvent AsyncCallback failed " + JSON.stringify(err)); + } else { + console.info("===============>FinishCommonEvent AsyncCallback success"); + } + done() + }) } async function subscriberCallBack0501(err, data) { @@ -489,10 +494,14 @@ describe('ActsSubscriberTestOrder', function () { expect(data.event).assertEqual('publish_event0500'); expect(data.code).assertEqual(10); expect(data.data).assertEqual('publish_event0500_init'); - commonEventSubscriber0501.finishCommonEvent().then(() => { - console.info('===============>subscriberCallBack0501 finishCommonEvent promise'); - done(); - }); + commonEventSubscriber0501.finishCommonEvent((err) => { + if (err.code) { + console.info("===============>finishCommonEvent AsyncCallback failed " + JSON.stringify(err)); + } else { + console.info("===============>FinishCommonEvent AsyncCallback success"); + } + done() + }) } Subscriber.createSubscriber( -- GitLab