aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/test/constant_test.js
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-07-28 15:18:57 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-07-28 15:18:57 -0700
commitc7f4d4fb84566992bc89d2ffceefdec1a2e83040 (patch)
tree64e813e8127ec9efb3cce41a1d8ccda7bdfd1037 /src/node/test/constant_test.js
parent8e06c2e62e0be2606598dd1f2a6582b585364520 (diff)
Wrap connectivity API, expose it to client as waitForReady
Diffstat (limited to 'src/node/test/constant_test.js')
-rw-r--r--src/node/test/constant_test.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/node/test/constant_test.js b/src/node/test/constant_test.js
index ecc98ec443..93bf0c8ada 100644
--- a/src/node/test/constant_test.js
+++ b/src/node/test/constant_test.js
@@ -78,6 +78,19 @@ var callErrorNames = [
'INVALID_FLAGS'
];
+/**
+ * List of all connectivity state names
+ * @const
+ * @type {Array.<string>}
+ */
+var connectivityStateNames = [
+ 'IDLE',
+ 'CONNECTING',
+ 'READY',
+ 'TRANSIENT_FAILURE',
+ 'FATAL_FAILURE'
+];
+
describe('constants', function() {
it('should have all of the status constants', function() {
for (var i = 0; i < statusNames.length; i++) {
@@ -91,4 +104,10 @@ describe('constants', function() {
'call error missing: ' + callErrorNames[i]);
}
});
+ it('should have all of the connectivity states', function() {
+ for (var i = 0; i < connectivityStateNames.length; i++) {
+ assert(grpc.connectivityState.hasOwnProperty(connectivityStateNames[i]),
+ 'connectivity status missing: ' + connectivityStateNames[i]);
+ }
+ });
});