Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: generated test fixes #155

Merged
merged 1 commit into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class Operation{
promise() {};
}

{%- if (service.simpleMethods.length > 0) %}
function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: FakeError | null) {
return (actualRequest: {}, options: {}, callback: Callback) => {
assert.deepStrictEqual(actualRequest, expectedRequest);
Expand All @@ -58,6 +59,7 @@ function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: F
}
};
}
{%- endif %}
{%- if (service.serverStreaming.length > 0) %}
function mockServerStreamingGrpcMethod(expectedRequest: {}, response: {} | null, error: FakeError | null) {
return (actualRequest: {}) => {
Expand Down Expand Up @@ -116,7 +118,7 @@ function mockLongRunningGrpcMethod(expectedRequest: {}, response: {} | null, err
};
}
{%- endif %}
describe('{{ service.name }}Client', () => {
describe('{{ api.naming.version }}.{{ service.name }}Client', () => {
it('has servicePath', () => {
const servicePath = {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client.servicePath;
assert(servicePath);
Expand All @@ -134,7 +136,7 @@ describe('{{ service.name }}Client', () => {
const client = new {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client();
assert(client);
});
it('should create a client with gRPC option', () => {
it('should create a client with gRPC fallback', () => {
const client = new {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client({
fallback: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class Operation{
constructor(){};
promise() {};
}

function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: FakeError | null) {
return (actualRequest: {}, options: {}, callback: Callback) => {
assert.deepStrictEqual(actualRequest, expectedRequest);
Expand All @@ -54,7 +53,7 @@ function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: F
}
};
}
describe('KeyManagementServiceClient', () => {
describe('v1.KeyManagementServiceClient', () => {
it('has servicePath', () => {
const servicePath = keymanagementserviceModule.v1.KeyManagementServiceClient.servicePath;
assert(servicePath);
Expand All @@ -72,7 +71,7 @@ describe('KeyManagementServiceClient', () => {
const client = new keymanagementserviceModule.v1.KeyManagementServiceClient();
assert(client);
});
it('should create a client with gRPC option', () => {
it('should create a client with gRPC fallback', () => {
const client = new keymanagementserviceModule.v1.KeyManagementServiceClient({
fallback: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class Operation{
constructor(){};
promise() {};
}

function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: FakeError | null) {
return (actualRequest: {}, options: {}, callback: Callback) => {
assert.deepStrictEqual(actualRequest, expectedRequest);
Expand Down Expand Up @@ -72,7 +71,7 @@ function mockLongRunningGrpcMethod(expectedRequest: {}, response: {} | null, err
return Promise.resolve([mockOperation]);
};
}
describe('CloudRedisClient', () => {
describe('v1beta1.CloudRedisClient', () => {
it('has servicePath', () => {
const servicePath = cloudredisModule.v1beta1.CloudRedisClient.servicePath;
assert(servicePath);
Expand All @@ -90,7 +89,7 @@ describe('CloudRedisClient', () => {
const client = new cloudredisModule.v1beta1.CloudRedisClient();
assert(client);
});
it('should create a client with gRPC option', () => {
it('should create a client with gRPC fallback', () => {
const client = new cloudredisModule.v1beta1.CloudRedisClient({
fallback: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export class Operation{
constructor(){};
promise() {};
}

function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: FakeError | null) {
return (actualRequest: {}, options: {}, callback: Callback) => {
assert.deepStrictEqual(actualRequest, expectedRequest);
Expand Down Expand Up @@ -108,7 +107,7 @@ function mockLongRunningGrpcMethod(expectedRequest: {}, response: {} | null, err
return Promise.resolve([mockOperation]);
};
}
describe('EchoClient', () => {
describe('v1beta1.EchoClient', () => {
it('has servicePath', () => {
const servicePath = echoModule.v1beta1.EchoClient.servicePath;
assert(servicePath);
Expand All @@ -126,7 +125,7 @@ describe('EchoClient', () => {
const client = new echoModule.v1beta1.EchoClient();
assert(client);
});
it('should create a client with gRPC option', () => {
it('should create a client with gRPC fallback', () => {
const client = new echoModule.v1beta1.EchoClient({
fallback: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class Operation{
constructor(){};
promise() {};
}

function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: FakeError | null) {
return (actualRequest: {}, options: {}, callback: Callback) => {
assert.deepStrictEqual(actualRequest, expectedRequest);
Expand All @@ -54,7 +53,7 @@ function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: F
}
};
}
describe('TextToSpeechClient', () => {
describe('v1.TextToSpeechClient', () => {
it('has servicePath', () => {
const servicePath = texttospeechModule.v1.TextToSpeechClient.servicePath;
assert(servicePath);
Expand All @@ -72,7 +71,7 @@ describe('TextToSpeechClient', () => {
const client = new texttospeechModule.v1.TextToSpeechClient();
assert(client);
});
it('should create a client with gRPC option', () => {
it('should create a client with gRPC fallback', () => {
const client = new texttospeechModule.v1.TextToSpeechClient({
fallback: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class Operation{
constructor(){};
promise() {};
}

function mockSimpleGrpcMethod(expectedRequest: {}, response: {} | null, error: FakeError | null) {
return (actualRequest: {}, options: {}, callback: Callback) => {
assert.deepStrictEqual(actualRequest, expectedRequest);
Expand Down Expand Up @@ -72,7 +71,7 @@ function mockLongRunningGrpcMethod(expectedRequest: {}, response: {} | null, err
return Promise.resolve([mockOperation]);
};
}
describe('TranslationServiceClient', () => {
describe('v3beta1.TranslationServiceClient', () => {
it('has servicePath', () => {
const servicePath = translationserviceModule.v3beta1.TranslationServiceClient.servicePath;
assert(servicePath);
Expand All @@ -90,7 +89,7 @@ describe('TranslationServiceClient', () => {
const client = new translationserviceModule.v3beta1.TranslationServiceClient();
assert(client);
});
it('should create a client with gRPC option', () => {
it('should create a client with gRPC fallback', () => {
const client = new translationserviceModule.v3beta1.TranslationServiceClient({
fallback: true,
});
Expand Down