Skip to content

Commit

Permalink
feat!: drop node8 support, support for async iterators (#167)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM.

New feature: methods with pagination now support async iteration.
  • Loading branch information
alexander-fenster authored Apr 2, 2020
1 parent 2324d29 commit f46a57c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions container-analysis/snippets/occurrencePubSub.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ async function main(
};

// Listen for new messages until timeout is hit
subscription.on(`message`, messageHandler);
subscription.on('message', messageHandler);

setTimeout(() => {
subscription.removeListener(`message`, messageHandler);
subscription.removeListener('message', messageHandler);
console.log(`Polled ${count} occurrences`);
}, timeoutSeconds * 1000);
// [END containeranalysis_pubsub]
Expand Down
10 changes: 5 additions & 5 deletions container-analysis/snippets/test/containerAnalysis.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const {assert} = require('chai');
const {describe, it, before, after, afterEach, beforeEach} = require('mocha');
const cp = require('child_process');
const uuid = require(`uuid`);
const uuid = require('uuid');

const {ContainerAnalysisClient} = require('@google-cloud/containeranalysis');
const client = new ContainerAnalysisClient();
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('Note tests', () => {
const output = execSync(
`node createOccurrence.js "${projectId}" "${noteId}" "${projectId}" "${resourceUrl}"`
);
assert.include(output, `Occurrence created`);
assert.include(output, 'Occurrence created');
});

it('should get occurrence', async () => {
Expand Down Expand Up @@ -233,7 +233,7 @@ describe('Note tests', () => {
const output = execSync(
`node deleteOccurrence.js "${projectId}" "${occurrenceId}"`
);
assert.include(output, `Occurrence deleted:`);
assert.include(output, 'Occurrence deleted:');
});
it('should delete note', () => {
const output = execSync(`node deleteNote.js "${projectId}" "${noteId}" `);
Expand Down Expand Up @@ -292,7 +292,7 @@ describe('polling', () => {
const output = execSync(
`node pollDiscoveryOccurrenceFinished.js "${projectId}" "${resourceUrl}" "${timeoutSeconds}"`
);
assert.include(output, `Found discovery occurrence`);
assert.include(output, 'Found discovery occurrence');
});
});

Expand Down Expand Up @@ -377,7 +377,7 @@ describe('pubsub', () => {
`node occurrencePubSub.js "${projectId}" "${subscriptionId}" "${timeoutSeconds}"`
);

assert.include(empty, `Polled 0 occurrences`);
assert.include(empty, 'Polled 0 occurrences');
// create test occurrences
for (let i = 0; i < expectedNum; i++) {
const [
Expand Down

0 comments on commit f46a57c

Please sign in to comment.