dubeejw closed pull request #102: Fixes #100
URL: https://github.com/apache/incubator-openwhisk-client-js/pull/102
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index 81cdbb2..8d6af41 100644
--- a/README.md
+++ b/README.md
@@ -493,16 +493,16 @@ Swagger parameter must be a well-formed JSON string, 
containing a valid Swagger
 
 ## Debugging
 
-Setting an environment parameter (`NODE_DEBUG=request`) will dump the HTTP 
requests from the client library and responses received to `stderr`.
+Setting an environment parameter (`DEBUG=needle`) will dump the HTTP requests 
from the client library and responses received to `stderr`.
 
 ```bash
-NODE_DEBUG=request node script.js
+DEBUG=needle node script.js
 ```
 
 This parameter can also be set dynamically at runtime, provided this happens 
before the `openwhisk` module is required.
 
 ```javascript
-process.env.NODE_DEBUG='request';
+process.env.DEBUG='needle';
 var openwhisk = require('openwhisk');
 ```
 
diff --git a/test/integration/triggers.test.js 
b/test/integration/triggers.test.js
index 4b68e2b..04515db 100644
--- a/test/integration/triggers.test.js
+++ b/test/integration/triggers.test.js
@@ -5,11 +5,12 @@
 
 const test = require('ava')
 const Triggers = require('../../lib/triggers.js')
+const Rules = require('../../lib/rules.js')
 const Client = require('../../lib/client.js')
 const Utils = require('./utils.js')
 
 const envParams = ['API_KEY', 'API_HOST', 'NAMESPACE']
-const options = Utils.autoOptions();
+const options = Utils.autoOptions()
 
 // check that mandatory configuration properties are available
 envParams.forEach(key => {
@@ -52,7 +53,7 @@ test('list all triggers using options namespace', t => {
 test('get a non-existing trigger, expecting 404', async t => {
   const triggers = new Triggers(new Client(options))
   await triggers.get({name: 'glorfindel'}).catch(err => {
-      t.is(err.statusCode, 404)
+    t.is(err.statusCode, 404)
   })
 })
 
@@ -107,11 +108,16 @@ test('fire a trigger', t => {
   }
 
   const triggers = new Triggers(new Client(options))
+  const rules = new Rules(new Client(options))
+
   return triggers.create({triggerName: 'random_fire_test'}).then(result => {
-    return triggers.invoke({triggerName: 
'random_fire_test'}).then(update_result => {
-      t.true(update_result.hasOwnProperty('activationId'))
-      t.pass()
-      return triggers.delete({triggerName: 'random_fire_test'}).catch(errors)
+    return rules.create({ruleName: 'echo_rule', action: 
`/whisk.system/utils/echo`, trigger: 
`/${NAMESPACE}/random_fire_test`}).then(rule_result => {
+      return triggers.invoke({triggerName: 
'random_fire_test'}).then(update_result => {
+        t.true(update_result.hasOwnProperty('activationId'))
+        t.pass()
+        return triggers.delete({triggerName: 'random_fire_test'})
+          .then(() => rules.delete({ruleName: 'echo_rule'}))
+      }).catch(errors)
     }).catch(errors)
   }).catch(errors)
 })


 

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


With regards,
Apache Git Services

Reply via email to