From 9d1e8bedfe35eae23d98fddee369db92ea9b8677 Mon Sep 17 00:00:00 2001 From: Richard Willis Date: Mon, 20 Apr 2020 19:12:32 +0100 Subject: [PATCH] grpc-js: Simplify client.waitForReady tests. Refs #1352 No need to add a service to the server to test the client. --- packages/grpc-js/test/test-client.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/grpc-js/test/test-client.ts b/packages/grpc-js/test/test-client.ts index e783b715c..4b02f3114 100644 --- a/packages/grpc-js/test/test-client.ts +++ b/packages/grpc-js/test/test-client.ts @@ -15,17 +15,11 @@ * */ -// Allow `any` data type for testing runtime type checking. -// tslint:disable no-any import * as assert from 'assert'; -import * as path from 'path'; import * as grpc from '../src'; import { Server, ServerCredentials } from '../src'; -import { ServiceClient, ServiceClientConstructor } from '../src/make-client'; -import { sendUnaryData, ServerUnaryCall } from '../src/server-call'; - -import { loadProtoFile } from './common'; +import { Client } from '../src'; import { ConnectivityState } from '../src/channel'; const clientInsecureCreds = grpc.credentials.createInsecure(); @@ -33,13 +27,9 @@ const serverInsecureCreds = ServerCredentials.createInsecure(); describe('Client', () => { let server: Server; - let client: ServiceClient; + let client: Client; before(done => { - const protoFile = path.join(__dirname, 'fixtures', 'echo_service.proto'); - const echoService = loadProtoFile(protoFile) - .EchoService as ServiceClientConstructor; - server = new Server(); server.bindAsync( @@ -47,7 +37,7 @@ describe('Client', () => { serverInsecureCreds, (err, port) => { assert.ifError(err); - client = new echoService( + client = new Client( `localhost:${port}`, clientInsecureCreds );