|
| 1 | +/** |
| 2 | + * Copyright 2016 Google Inc. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +'use strict'; |
| 18 | + |
| 19 | +var assert = require('assert'); |
| 20 | +var proxyquire = require('proxyquire'); |
| 21 | + |
| 22 | +var fakeGrpcOperation = {}; |
| 23 | +var fakeGrpcService = {}; |
| 24 | +var fakeGrpcServiceObject = {}; |
| 25 | +var fakeService = {}; |
| 26 | +var fakeServiceObject = {}; |
| 27 | +var fakeStreamRouter = {}; |
| 28 | +var fakeUtil = {}; |
| 29 | + |
| 30 | +describe('common', function() { |
| 31 | + var common; |
| 32 | + |
| 33 | + before(function() { |
| 34 | + common = proxyquire('../src/index.js', { |
| 35 | + './grpc-operation.js': fakeGrpcOperation, |
| 36 | + './grpc-service.js': fakeGrpcService, |
| 37 | + './grpc-service-object.js': fakeGrpcServiceObject, |
| 38 | + './service.js': fakeService, |
| 39 | + './service-object.js': fakeServiceObject, |
| 40 | + './stream-router.js': fakeStreamRouter, |
| 41 | + './util.js': fakeUtil |
| 42 | + }); |
| 43 | + }); |
| 44 | + |
| 45 | + it('should correctly export the common modules', function() { |
| 46 | + assert.deepEqual(common, { |
| 47 | + GrpcOperation: fakeGrpcOperation, |
| 48 | + GrpcService: fakeGrpcService, |
| 49 | + GrpcServiceObject: fakeGrpcServiceObject, |
| 50 | + Service: fakeService, |
| 51 | + ServiceObject: fakeServiceObject, |
| 52 | + streamRouter: fakeStreamRouter, |
| 53 | + util: fakeUtil |
| 54 | + }); |
| 55 | + }); |
| 56 | +}); |
0 commit comments