Skip to content

Commit

Permalink
Switch to let/const (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpebot authored and sofisl committed Oct 13, 2022
1 parent 8cfd180 commit 9e18cee
Show file tree
Hide file tree
Showing 12 changed files with 418 additions and 366 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ describe('DataTransferServiceSmokeTest', () => {
if (!process.env.GCLOUD_PROJECT) {
throw new Error('Usage: GCLOUD_PROJECT=<project_id> node #{$0}');
}
var projectId = process.env.GCLOUD_PROJECT;
const projectId = process.env.GCLOUD_PROJECT;

it('successfully makes a call to the service using promises', done => {
const bigqueryDataTransfer = require('../src');

var client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
// optional auth parameters.
});

// Iterate over all elements.
var formattedParent = client.projectPath(projectId);
const formattedParent = client.projectPath(projectId);

client
.listDataSources({parent: formattedParent})
.then(responses => {
var resources = responses[0];
const resources = responses[0];
for (let i = 0; i < resources.length; i += 1) {
console.log(resources[i]);
}
Expand All @@ -45,21 +45,21 @@ describe('DataTransferServiceSmokeTest', () => {
it('successfully makes a call to the service using callbacks', done => {
const bigqueryDataTransfer = require('../src');

var client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
// optional auth parameters.
});

// Or obtain the paged response.
var formattedParent = client.projectPath(projectId);
const formattedParent = client.projectPath(projectId);

var options = {autoPaginate: false};
var callback = responses => {
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
var resources = responses[0];
const resources = responses[0];
// The next request if the response shows that there are more responses.
var nextRequest = responses[1];
const nextRequest = responses[1];
// The actual response object, if necessary.
// var rawResponse = responses[2];
// const rawResponse = responses[2];
for (let i = 0; i < resources.length; i += 1) {
console.log(resources[i]);
}
Expand All @@ -78,11 +78,11 @@ describe('DataTransferServiceSmokeTest', () => {
it('successfully makes a call to the service using streaming', done => {
const bigqueryDataTransfer = require('../src');

var client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
// optional auth parameters.
});

var formattedParent = client.projectPath(projectId);
const formattedParent = client.projectPath(projectId);
client
.listDataSourcesStream({parent: formattedParent})
.on('data', element => {
Expand Down
Loading

0 comments on commit 9e18cee

Please sign in to comment.