Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
fix: better client close(), update .nycrc, require mocha explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and alexander-fenster committed Jan 5, 2020
1 parent 3f56036 commit 824e75c
Show file tree
Hide file tree
Showing 7 changed files with 1,651 additions and 1,400 deletions.
1 change: 1 addition & 0 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"**/scripts",
"**/protos",
"**/test",
"**/*.d.ts",
".jsdoc.js",
"**/.jsdoc.js",
"karma.conf.js",
Expand Down
2 changes: 1 addition & 1 deletion protos/protos.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/protos.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions src/v1/speech_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ export class SpeechClient {
for (const methodName of speechStubMethods) {
const innerCallPromise = this.speechStub.then(
stub => (...args: Array<{}>) => {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return stub[methodName].apply(stub, args);
},
(err: Error | null | undefined) => () => {
Expand All @@ -228,9 +231,6 @@ export class SpeechClient {
callOptions?: CallOptions,
callback?: APICallback
) => {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return apiCall(argument, callOptions, callback);
};
}
Expand Down
6 changes: 3 additions & 3 deletions src/v1p1beta1/speech_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ export class SpeechClient {
for (const methodName of speechStubMethods) {
const innerCallPromise = this.speechStub.then(
stub => (...args: Array<{}>) => {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return stub[methodName].apply(stub, args);
},
(err: Error | null | undefined) => () => {
Expand All @@ -228,9 +231,6 @@ export class SpeechClient {
callOptions?: CallOptions,
callback?: APICallback
) => {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return apiCall(argument, callOptions, callback);
};
}
Expand Down
Loading

0 comments on commit 824e75c

Please sign in to comment.