Skip to content

Commit

Permalink
fix: do not modify options object, use defaultScopes (#413)
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 6, 2020
1 parent e699aea commit 746a751
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 178 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-bigquery-datatransfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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
1 change: 1 addition & 0 deletions packages/google-cloud-bigquery-datatransfer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import * as v1 from './v1';

const DataTransferServiceClient = v1.DataTransferServiceClient;
type DataTransferServiceClient = v1.DataTransferServiceClient;

export {v1, DataTransferServiceClient};
export default {v1, DataTransferServiceClient};
Expand Down

Large diffs are not rendered by default.

16 changes: 5 additions & 11 deletions packages/google-cloud-bigquery-datatransfer/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@
{
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-bigquery-data-transfer.git",
"sha": "04385549bbb8b2014ffa1ea5ee78703ad567e1c9"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb",
"internalRef": "327369997"
"remote": "git@github.com:googleapis/nodejs-bigquery-data-transfer.git",
"sha": "fdd5815ed48fdb8bfe619c4303707c990b062436"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "ba9918cd22874245b55734f57470c719b577e591"
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
}
}
],
Expand Down Expand Up @@ -87,13 +79,15 @@
"README.md",
"api-extractor.json",
"linkinator.config.json",
"package-lock.json.3950038425",
"protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto",
"protos/google/cloud/bigquery/datatransfer/v1/transfer.proto",
"protos/protos.d.ts",
"protos/protos.js",
"protos/protos.json",
"renovate.json",
"samples/README.md",
"samples/package-lock.json.2364870502",
"src/index.ts",
"src/v1/data_transfer_service_client.ts",
"src/v1/data_transfer_service_client_config.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@

import {DataTransferServiceClient} from '@google-cloud/bigquery-data-transfer';

// check that the client class type name can be used
function doStuffWithDataTransferServiceClient(
client: DataTransferServiceClient
) {
client.close();
}

function main() {
new DataTransferServiceClient();
// check that the client instance can be created
const dataTransferServiceClient = new DataTransferServiceClient();
doStuffWithDataTransferServiceClient(dataTransferServiceClient);
}

main();
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 746a751

Please sign in to comment.