Skip to content

Commit

Permalink
Merge pull request #67 from yandex-cloud/CLOUD-86841
Browse files Browse the repository at this point in the history
Update nice-grc
  • Loading branch information
DavyJohnes committed Feb 16, 2022
2 parents 4668978 + 19129f3 commit 9367aba
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 55 deletions.
98 changes: 49 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"log4js": "6.3.0",
"long": "5.2.0",
"luxon": "2.2.0",
"nice-grpc": "1.0.4",
"nice-grpc-client-middleware-deadline": "1.0.4",
"nice-grpc": "1.0.6",
"nice-grpc-client-middleware-deadline": "1.0.6",
"protobufjs": "6.8.8",
"utility-types": "3.10.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/service-endpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ describe('service endpoints', () => {
const serviceName = 'myCustomService';

expect(() => {
getServiceClientEndpoint({ options: { serviceName } } as unknown as MockServiceClientCtor);
getServiceClientEndpoint({ serviceName } as unknown as MockServiceClientCtor);
}).toThrow(`Endpoint for service ${serviceName} is no defined`);
});

it('should throw exception if client class has no serviceName option', () => {
expect(() => {
getServiceClientEndpoint({ options: {} } as unknown as MockServiceClientCtor);
getServiceClientEndpoint({} as unknown as MockServiceClientCtor);
}).toThrow('Unable to retrieve serviceName of provided service client class');
});
});
3 changes: 1 addition & 2 deletions src/service-endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,7 @@ const SERVICE_ENDPOINTS_LIST: ServiceEndpointsList = [

export const getServiceClientEndpoint = <T extends ServiceDefinition>(generatedClientCtor: GeneratedServiceClientCtor<T>): string => {
const clientCtor = generatedClientCtor as unknown as ServiceClientConstructor;
// eslint-disable-next-line prefer-destructuring
const serviceName: string = clientCtor.options.serviceName as string;
const serviceName: string = clientCtor.serviceName as string;

if (!serviceName) {
throw new Error('Unable to retrieve serviceName of provided service client class');
Expand Down

0 comments on commit 9367aba

Please sign in to comment.