Skip to content

Commit

Permalink
fix: regen protos and tests, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster committed May 6, 2020
1 parent 2e973a5 commit 0fe4d96
Show file tree
Hide file tree
Showing 12 changed files with 296 additions and 341 deletions.
420 changes: 210 additions & 210 deletions protos/protos.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions samples/listenForErrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function main(subscriptionName = 'YOUR_SUBSCRIPTION_NAME', timeout = 10) {
const subscription = pubSubClient.subscription(subscriptionName);

// Create an event handler to handle messages
const messageHandler = function (message) {
const messageHandler = function(message) {
// Do something with the message
console.log(`Message: ${message}`);

Expand All @@ -57,7 +57,7 @@ async function main(subscriptionName = 'YOUR_SUBSCRIPTION_NAME', timeout = 10) {
};

// Create an event handler to handle errors
const errorHandler = function (error) {
const errorHandler = function(error) {
// Do something with the error
console.error(`ERROR: ${error}`);
throw error;
Expand Down
2 changes: 1 addition & 1 deletion samples/listenForOrderedMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function main(
const subscription = pubSubClient.subscription(subscriptionName);

// Create an event handler to handle messages
const messageHandler = function (message) {
const messageHandler = function(message) {
// Buffer the message in an object (for later ordering)
outstandingMessages[message.attributes.counterId] = message;

Expand Down
14 changes: 3 additions & 11 deletions 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-pubsub.git",
"sha": "aef28daccfbf0be39c740bde6cdd51a499571555"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab",
"internalRef": "307114445"
"remote": "git@github.com:googleapis/nodejs-pubsub.git",
"sha": "2e973a55008c4d50ef3f7d47ac4ba761cd2ea9cb"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "f5e4c17dc78a966dbf29961dd01f9bbd63e20a04"
"sha": "ab883569eb0257bbf16a6d825fd018b3adde3912"
}
}
],
Expand Down
7 changes: 5 additions & 2 deletions system-test/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ const CURRENT_TIME = Date.now();
const pubsub = new PubSub();

function shortUUID() {
return uuid.v1().split('-').shift();
return uuid
.v1()
.split('-')
.shift();
}

describe('pubsub', () => {
Expand Down Expand Up @@ -657,7 +660,7 @@ describe('pubsub', () => {

// can be ran manually to test options/memory usage/etc.
// tslint:disable-next-line ban
it.skip('should handle a large volume of messages', async function () {
it.skip('should handle a large volume of messages', async function() {
const MESSAGES = 200000;

const deferred = defer();
Expand Down
68 changes: 26 additions & 42 deletions test/gapic_publisher_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ describe('v1.PublisherClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.createTopic(request);
}, expectedError);
await assert.rejects(client.createTopic(request), expectedError);
assert(
(client.innerApiCalls.createTopic as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -414,9 +412,7 @@ describe('v1.PublisherClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.updateTopic(request);
}, expectedError);
await assert.rejects(client.updateTopic(request), expectedError);
assert(
(client.innerApiCalls.updateTopic as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -525,9 +521,7 @@ describe('v1.PublisherClient', () => {
};
const expectedError = new Error('expected');
client.innerApiCalls.publish = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.publish(request);
}, expectedError);
await assert.rejects(client.publish(request), expectedError);
assert(
(client.innerApiCalls.publish as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -636,9 +630,7 @@ describe('v1.PublisherClient', () => {
};
const expectedError = new Error('expected');
client.innerApiCalls.getTopic = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.getTopic(request);
}, expectedError);
await assert.rejects(client.getTopic(request), expectedError);
assert(
(client.innerApiCalls.getTopic as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -750,9 +742,7 @@ describe('v1.PublisherClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.deleteTopic(request);
}, expectedError);
await assert.rejects(client.deleteTopic(request), expectedError);
assert(
(client.innerApiCalls.deleteTopic as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -868,9 +858,7 @@ describe('v1.PublisherClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listTopics(request);
}, expectedError);
await assert.rejects(client.listTopics(request), expectedError);
assert(
(client.innerApiCalls.listTopics as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -954,9 +942,7 @@ describe('v1.PublisherClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listTopics.createStream as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1145,9 +1131,10 @@ describe('v1.PublisherClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listTopicSubscriptions(request);
}, expectedError);
await assert.rejects(
client.listTopicSubscriptions(request),
expectedError
);
assert(
(client.innerApiCalls.listTopicSubscriptions as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1229,9 +1216,7 @@ describe('v1.PublisherClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listTopicSubscriptions
.createStream as SinonStub)
Expand Down Expand Up @@ -1418,9 +1403,7 @@ describe('v1.PublisherClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listTopicSnapshots(request);
}, expectedError);
await assert.rejects(client.listTopicSnapshots(request), expectedError);
assert(
(client.innerApiCalls.listTopicSnapshots as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1501,9 +1484,7 @@ describe('v1.PublisherClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listTopicSnapshots.createStream as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1685,9 +1666,10 @@ describe('v1.PublisherClient', () => {
};
const expectedError = new Error('expected');
client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.getIamPolicy(request, expectedOptions);
}, expectedError);
await assert.rejects(
client.getIamPolicy(request, expectedOptions),
expectedError
);
assert(
(client.iamClient.getIamPolicy as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1790,9 +1772,10 @@ describe('v1.PublisherClient', () => {
};
const expectedError = new Error('expected');
client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.setIamPolicy(request, expectedOptions);
}, expectedError);
await assert.rejects(
client.setIamPolicy(request, expectedOptions),
expectedError
);
assert(
(client.iamClient.setIamPolicy as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1901,9 +1884,10 @@ describe('v1.PublisherClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.testIamPermissions(request, expectedOptions);
}, expectedError);
await assert.rejects(
client.testIamPermissions(request, expectedOptions),
expectedError
);
assert(
(client.iamClient.testIamPermissions as SinonStub)
.getCall(0)
Expand Down

0 comments on commit 0fe4d96

Please sign in to comment.