Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Aug 19, 2023
1 parent 867c502 commit c8f8e37
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Client from './client/Client';
import Server from './server/Server';
import Client, { ClientOptions } from './client/Client';
import Server, { ServerOptions } from './server/Server';
import * as utils from './utils';
import * as RuntimeTypes from '../proto/runtime/v1/runtime_pb';
import * as Types from './types';

export {
Client,
ClientOptions,
Server,
ServerOptions,
utils,
RuntimeTypes,
Types,
Expand Down
4 changes: 3 additions & 1 deletion test/unit/client/Client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ describe('client/Client.test.ts', () => {
describe('custom Client', () => {
let customClient: CustomClient;
beforeAll(() => {
customClient = new CustomClient();
customClient = new CustomClient({
logger: console,
});
});

it('should work', async () => {
Expand Down
11 changes: 10 additions & 1 deletion test/unit/client/fixtures/CustomClient.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { Client } from '../../../../src';
import { Client, ClientOptions } from '../../../../src';
import { CustomHello } from './CustomHello';

export interface CustomClientOptions extends ClientOptions {
port?: string;
host?: string;
}

export class CustomClient extends Client {
private _customHello: CustomHello;

constructor(options: CustomClientOptions) {
super(options.port, options.host, options);
}

get hello() {
if (!this._customHello) {
this._customHello = new CustomHello(this._runtime, this.initAPIOptions);
Expand Down

0 comments on commit c8f8e37

Please sign in to comment.