aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/test/surface_test.js
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-04-20 11:22:51 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-04-20 11:22:51 -0700
commit71dbb8636d75d7de0cb575c2156c3d16a34470b7 (patch)
treeec0c3f788a862ae92b03f401e1dd1fdf0dc618ef /src/node/test/surface_test.js
parentb572fcba35fd66cce102b29389a5892d3d45e651 (diff)
Added JSON option for gRPC file loading
Diffstat (limited to 'src/node/test/surface_test.js')
-rw-r--r--src/node/test/surface_test.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js
index 590c644c71..6f63f1044f 100644
--- a/src/node/test/surface_test.js
+++ b/src/node/test/surface_test.js
@@ -47,6 +47,28 @@ var mathService = math_proto.lookup('math.Math');
var capitalize = require('underscore.string/capitalize');
+describe('File loader', function() {
+ it('Should load a proto file by default', function() {
+ assert.doesNotThrow(function() {
+ grpc.load(__dirname + '/test_service.proto');
+ });
+ });
+ it('Should load a proto file with the proto format', function() {
+ assert.doesNotThrow(function() {
+ grpc.load(__dirname + '/test_service.proto', 'proto');
+ });
+ });
+ it('Should load a json file with the json format', function() {
+ assert.doesNotThrow(function() {
+ grpc.load(__dirname + '/test_service.json', 'json');
+ });
+ });
+ it('Should fail to load a file with an unknown format', function() {
+ assert.throws(function() {
+ grpc.load(__dirname + '/test_service.proto', 'fake_format');
+ });
+ });
+});
describe('Surface server constructor', function() {
it('Should fail with conflicting method names', function() {
assert.throws(function() {