Skip to content

Commit

Permalink
test: update code style of smoke test (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Feb 5, 2019
1 parent 38c0e8c commit 0bb6fbc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
18 changes: 7 additions & 11 deletions smoke-test/publisher_smoke_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe('PublisherSmokeTest', () => {
.listTopics({project: formattedProject})
.then(responses => {
const resources = responses[0];
for (let i = 0; i < resources.length; i += 1) {
console.log(resources[i]);
for (const resource of resources) {
console.log(resource);
}
})
.then(done)
Expand All @@ -60,8 +60,8 @@ describe('PublisherSmokeTest', () => {
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (let i = 0; i < resources.length; i += 1) {
console.log(resources[i]);
for (const resource of resources) {
console.log(resource);
}
if (nextRequest) {
// Fetch the next page.
Expand All @@ -83,16 +83,12 @@ describe('PublisherSmokeTest', () => {
});

const formattedProject = client.projectPath(projectId);
let counter = 0;
client
.listTopicsStream({project: formattedProject})
.on('data', () => {
++counter;
.on('data', element => {
console.log(element);
})
.on('error', done)
.on('end', () => {
console.log(`${counter} elements received.`);
done();
});
.on('end', done);
});
});
16 changes: 8 additions & 8 deletions src/v1/publisher_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ class PublisherClient {
* client.listTopics({project: formattedProject})
* .then(responses => {
* const resources = responses[0];
* for (let i = 0; i < resources.length; i += 1) {
* // doThingsWith(resources[i])
* for (const resource of resources) {
* // doThingsWith(resource)
* }
* })
* .catch(err => {
Expand All @@ -582,8 +582,8 @@ class PublisherClient {
* const nextRequest = responses[1];
* // The actual response object, if necessary.
* // const rawResponse = responses[2];
* for (let i = 0; i < resources.length; i += 1) {
* // doThingsWith(resources[i]);
* for (const resource of resources) {
* // doThingsWith(resource);
* }
* if (nextRequest) {
* // Fetch the next page.
Expand Down Expand Up @@ -713,8 +713,8 @@ class PublisherClient {
* client.listTopicSubscriptions({topic: formattedTopic})
* .then(responses => {
* const resources = responses[0];
* for (let i = 0; i < resources.length; i += 1) {
* // doThingsWith(resources[i])
* for (const resource of resources) {
* // doThingsWith(resource)
* }
* })
* .catch(err => {
Expand All @@ -733,8 +733,8 @@ class PublisherClient {
* const nextRequest = responses[1];
* // The actual response object, if necessary.
* // const rawResponse = responses[2];
* for (let i = 0; i < resources.length; i += 1) {
* // doThingsWith(resources[i]);
* for (const resource of resources) {
* // doThingsWith(resource);
* }
* if (nextRequest) {
* // Fetch the next page.
Expand Down
16 changes: 8 additions & 8 deletions src/v1/subscriber_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ class SubscriberClient {
* client.listSubscriptions({project: formattedProject})
* .then(responses => {
* const resources = responses[0];
* for (let i = 0; i < resources.length; i += 1) {
* // doThingsWith(resources[i])
* for (const resource of resources) {
* // doThingsWith(resource)
* }
* })
* .catch(err => {
Expand All @@ -594,8 +594,8 @@ class SubscriberClient {
* const nextRequest = responses[1];
* // The actual response object, if necessary.
* // const rawResponse = responses[2];
* for (let i = 0; i < resources.length; i += 1) {
* // doThingsWith(resources[i]);
* for (const resource of resources) {
* // doThingsWith(resource);
* }
* if (nextRequest) {
* // Fetch the next page.
Expand Down Expand Up @@ -1053,8 +1053,8 @@ class SubscriberClient {
* client.listSnapshots({project: formattedProject})
* .then(responses => {
* const resources = responses[0];
* for (let i = 0; i < resources.length; i += 1) {
* // doThingsWith(resources[i])
* for (const resource of resources) {
* // doThingsWith(resource)
* }
* })
* .catch(err => {
Expand All @@ -1073,8 +1073,8 @@ class SubscriberClient {
* const nextRequest = responses[1];
* // The actual response object, if necessary.
* // const rawResponse = responses[2];
* for (let i = 0; i < resources.length; i += 1) {
* // doThingsWith(resources[i]);
* for (const resource of resources) {
* // doThingsWith(resource);
* }
* if (nextRequest) {
* // Fetch the next page.
Expand Down
10 changes: 5 additions & 5 deletions synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-01-26T12:16:21.653703Z",
"updateTime": "2019-02-05T12:16:03.207914Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.7",
"dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80"
"version": "0.16.9",
"dockerImage": "googleapis/artman@sha256:80c39fa84e7203c8f355e01bdeef82155013cc39dcaa48fba7a6fe2c253623e3"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "a6b4398490269577fc511f297b85763ba4701403",
"internalRef": "230969086"
"sha": "f26c727dde5051abefc5ad9e7dee82a2686ad2b0",
"internalRef": "232306662"
}
},
{
Expand Down

0 comments on commit 0bb6fbc

Please sign in to comment.