You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2018/03/23 11:19:15 UTC

[incubator-openwhisk-client-js] branch issue_8_count updated: add tests for count query param

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch issue_8_count
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-client-js.git


The following commit(s) were added to refs/heads/issue_8_count by this push:
     new 62d2673  add tests for count query param
62d2673 is described below

commit 62d2673673157c412d0399ef2e017793bb2df4f5
Author: Carlos Santana <cs...@apache.org>
AuthorDate: Fri Mar 23 07:19:09 2018 -0400

    add tests for count query param
---
 test/unit/actions.test.js     | 14 ++++++++++++++
 test/unit/activations.test.js | 14 ++++++++++++++
 test/unit/packages.test.js    | 14 ++++++++++++++
 test/unit/rules.test.js       | 14 ++++++++++++++
 test/unit/triggers.test.js    | 15 +++++++++++++++
 5 files changed, 71 insertions(+)

diff --git a/test/unit/actions.test.js b/test/unit/actions.test.js
index 715639a..b1b552a 100644
--- a/test/unit/actions.test.js
+++ b/test/unit/actions.test.js
@@ -35,6 +35,20 @@ test('should list all actions with parameters', t => {
   return actions.list({namespace: 'custom', skip: 100, limit: 100})
 })
 
+test('should list all actions with parameter count', t => {
+  t.plan(3)
+  const client = {}
+  const actions = new Actions(client)
+
+  client.request = (method, path, options) => {
+    t.is(method, 'GET')
+    t.is(path, `namespaces/custom/actions`)
+    t.deepEqual(options.qs, {count: true})
+  }
+
+  return actions.list({namespace: 'custom', count: true})
+})
+
 test('should retrieve action from identifier', t => {
   t.plan(2)
   const ns = '_'
diff --git a/test/unit/activations.test.js b/test/unit/activations.test.js
index d9607b5..0d6e31d 100644
--- a/test/unit/activations.test.js
+++ b/test/unit/activations.test.js
@@ -35,6 +35,20 @@ test('list all activations', t => {
   return activations.list({namespace: 'options_namespace', name: 'Hello', limit: 100, skip: 100, since: 100, upto: 100, docs: true})
 })
 
+test('list all activations with count parameter', t => {
+  t.plan(3)
+  const client = {}
+  const activations = new Activations(client)
+
+  client.request = (method, path, options) => {
+    t.is(method, 'GET')
+    t.is(path, `namespaces/options_namespace/activations`)
+    t.deepEqual(options.qs, {name: 'Hello', count: true})
+  }
+
+  return activations.list({namespace: 'options_namespace', name: 'Hello', count: true})
+})
+
 test('should retrieve an activation', t => {
   t.plan(2)
   const ns = '_'
diff --git a/test/unit/packages.test.js b/test/unit/packages.test.js
index 8fcb2fc..e02558e 100644
--- a/test/unit/packages.test.js
+++ b/test/unit/packages.test.js
@@ -35,6 +35,20 @@ test('should list all packages with parameters', t => {
   return packages.list({namespace: 'custom', skip: 100, limit: 100})
 })
 
+test('should list all packages with parameter count', t => {
+  t.plan(3)
+  const client = {}
+  const packages = new Packages(client)
+
+  client.request = (method, path, options) => {
+    t.is(method, 'GET')
+    t.is(path, `namespaces/custom/packages`)
+    t.deepEqual(options.qs, {count: true})
+  }
+
+  return packages.list({namespace: 'custom', count: true})
+})
+
 test('should retrieve package from string identifier', t => {
   t.plan(2)
   const ns = '_'
diff --git a/test/unit/rules.test.js b/test/unit/rules.test.js
index d1365c1..b2b8265 100644
--- a/test/unit/rules.test.js
+++ b/test/unit/rules.test.js
@@ -35,6 +35,20 @@ test('should list all rules with parameters', t => {
   return rules.list({namespace: 'custom', skip: 100, limit: 100})
 })
 
+test('should list all rules with parameter count', t => {
+  t.plan(3)
+  const client = { options: {} }
+  const rules = new Rules(client)
+
+  client.request = (method, path, options) => {
+    t.is(method, 'GET')
+    t.is(path, `namespaces/custom/rules`)
+    t.deepEqual(options.qs, {count: true})
+  }
+
+  return rules.list({namespace: 'custom', count: true})
+})
+
 test('should retrieve rule from identifier', t => {
   t.plan(2)
   const ns = '_'
diff --git a/test/unit/triggers.test.js b/test/unit/triggers.test.js
index 81e3933..d855727 100644
--- a/test/unit/triggers.test.js
+++ b/test/unit/triggers.test.js
@@ -36,6 +36,21 @@ test('should list all triggers with parameters', t => {
   return triggers.list({namespace: 'custom', skip: 100, limit: 100})
 })
 
+test('should list all triggers with parameter count', t => {
+  t.plan(3)
+  const ns = '_'
+  const client = {}
+  const triggers = new Triggers(client)
+
+  client.request = (method, path, options) => {
+    t.is(method, 'GET')
+    t.is(path, `namespaces/custom/triggers`)
+    t.deepEqual(options.qs, {count: true})
+  }
+
+  return triggers.list({namespace: 'custom', count: true})
+})
+
 test('should retrieve trigger from identifier', t => {
   t.plan(2)
   const ns = '_'

-- 
To stop receiving notification emails like this one, please contact
csantanapr@apache.org.