You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2020/01/20 12:50:41 UTC

[GitHub] [openwhisk-client-js] upgle commented on a change in pull request #199: Handle a blocking/result response that is demoted to async.

upgle commented on a change in pull request #199: Handle a blocking/result response that is demoted to async.
URL: https://github.com/apache/openwhisk-client-js/pull/199#discussion_r368531128
 
 

 ##########
 File path: test/unit/actions.test.js
 ##########
 @@ -246,6 +246,25 @@ test('should invoke action to retrieve result', t => {
   })
 })
 
+test('should invoke action to retrieve result but request is demoted to async', t => {
+  t.plan(4)
+  const ns = '_'
+  const client = {}
+  const actions = new Actions(client)
+  const result = { activationId: '123456' }
+
+  client.request = (method, path, options) => {
+    t.is(method, 'POST')
+    t.is(path, `namespaces/${ns}/actions/12345`)
+    t.deepEqual(options.qs, { blocking: true })
+    return Promise.resolve(result)
+  }
+
+  return actions.invoke({ name: '12345', result: true, blocking: true }).catch(_result => {
 
 Review comment:
   LGTM 👍 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services