Skip to content

Commit

Permalink
fix: do not modify options object, use defaultScopes (#132)
Browse files Browse the repository at this point in the history
Regenerated the library using
[gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript)
v1.2.1.
  • Loading branch information
alexander-fenster authored Nov 7, 2020
1 parent c4d64f4 commit 3b4e190
Show file tree
Hide file tree
Showing 8 changed files with 570 additions and 389 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-gaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"api-documenter": "api-documenter yaml --input-folder=temp"
},
"dependencies": {
"google-gax": "^2.1.0"
"google-gax": "^2.9.2"
},
"devDependencies": {
"@types/mocha": "^8.0.0",
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

219 changes: 127 additions & 92 deletions packages/google-cloud-gaming/src/v1beta/realms_service_client.ts

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion packages/google-cloud-gaming/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "ba9918cd22874245b55734f57470c719b577e591"
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
}
}
],
Expand Down Expand Up @@ -96,6 +96,7 @@
"README.md",
"api-extractor.json",
"linkinator.config.json",
"package-lock.json.742240568",
"protos/google/cloud/gaming/v1beta/common.proto",
"protos/google/cloud/gaming/v1beta/game_server_clusters.proto",
"protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto",
Expand All @@ -110,6 +111,7 @@
"protos/protos.json",
"renovate.json",
"samples/README.md",
"samples/package-lock.json.3225038820",
"src/index.ts",
"src/v1beta/game_server_clusters_service_client.ts",
"src/v1beta/game_server_clusters_service_client_config.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,41 @@ import {
RealmsServiceClient,
} from '@google-cloud/game-servers';

// check that the client class type name can be used
function doStuffWithGameServerClustersServiceClient(
client: GameServerClustersServiceClient
) {
client.close();
}
function doStuffWithGameServerConfigsServiceClient(
client: GameServerConfigsServiceClient
) {
client.close();
}
function doStuffWithGameServerDeploymentsServiceClient(
client: GameServerDeploymentsServiceClient
) {
client.close();
}
function doStuffWithRealmsServiceClient(client: RealmsServiceClient) {
client.close();
}

function main() {
new GameServerClustersServiceClient();
new GameServerConfigsServiceClient();
new GameServerDeploymentsServiceClient();
new RealmsServiceClient();
// check that the client instance can be created
const gameServerClustersServiceClient = new GameServerClustersServiceClient();
doStuffWithGameServerClustersServiceClient(gameServerClustersServiceClient);
// check that the client instance can be created
const gameServerConfigsServiceClient = new GameServerConfigsServiceClient();
doStuffWithGameServerConfigsServiceClient(gameServerConfigsServiceClient);
// check that the client instance can be created
const gameServerDeploymentsServiceClient = new GameServerDeploymentsServiceClient();
doStuffWithGameServerDeploymentsServiceClient(
gameServerDeploymentsServiceClient
);
// check that the client instance can be created
const realmsServiceClient = new RealmsServiceClient();
doStuffWithRealmsServiceClient(realmsServiceClient);
}

main();
18 changes: 9 additions & 9 deletions packages/google-cloud-gaming/system-test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play';
import {readFileSync} from 'fs';
import {describe, it} from 'mocha';

describe('typescript consumer tests', () => {
it('should have correct type signature for typescript users', async function () {
describe('📦 pack-n-play test', () => {
it('TypeScript code', async function () {
this.timeout(300000);
const options = {
packageDir: process.cwd(), // path to your module.
packageDir: process.cwd(),
sample: {
description: 'typescript based user can use the type definitions',
description: 'TypeScript user can use the type definitions',
ts: readFileSync(
'./system-test/fixtures/sample/src/index.ts'
).toString(),
},
};
await packNTest(options); // will throw upon error.
await packNTest(options);
});

it('should have correct type signature for javascript users', async function () {
it('JavaScript code', async function () {
this.timeout(300000);
const options = {
packageDir: process.cwd(), // path to your module.
packageDir: process.cwd(),
sample: {
description: 'typescript based user can use the type definitions',
description: 'JavaScript user can use the library',
ts: readFileSync(
'./system-test/fixtures/sample/src/index.js'
).toString(),
},
};
await packNTest(options); // will throw upon error.
await packNTest(options);
});
});

0 comments on commit 3b4e190

Please sign in to comment.