Skip to content

Commit f46a57c

Browse files
feat!: drop node8 support, support for async iterators (#167)
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.
1 parent 2324d29 commit f46a57c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

container-analysis/snippets/occurrencePubSub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ async function main(
4444
};
4545

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

4949
setTimeout(() => {
50-
subscription.removeListener(`message`, messageHandler);
50+
subscription.removeListener('message', messageHandler);
5151
console.log(`Polled ${count} occurrences`);
5252
}, timeoutSeconds * 1000);
5353
// [END containeranalysis_pubsub]

container-analysis/snippets/test/containerAnalysis.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
const {assert} = require('chai');
1818
const {describe, it, before, after, afterEach, beforeEach} = require('mocha');
1919
const cp = require('child_process');
20-
const uuid = require(`uuid`);
20+
const uuid = require('uuid');
2121

2222
const {ContainerAnalysisClient} = require('@google-cloud/containeranalysis');
2323
const client = new ContainerAnalysisClient();
@@ -81,7 +81,7 @@ describe('Note tests', () => {
8181
const output = execSync(
8282
`node createOccurrence.js "${projectId}" "${noteId}" "${projectId}" "${resourceUrl}"`
8383
);
84-
assert.include(output, `Occurrence created`);
84+
assert.include(output, 'Occurrence created');
8585
});
8686

8787
it('should get occurrence', async () => {
@@ -233,7 +233,7 @@ describe('Note tests', () => {
233233
const output = execSync(
234234
`node deleteOccurrence.js "${projectId}" "${occurrenceId}"`
235235
);
236-
assert.include(output, `Occurrence deleted:`);
236+
assert.include(output, 'Occurrence deleted:');
237237
});
238238
it('should delete note', () => {
239239
const output = execSync(`node deleteNote.js "${projectId}" "${noteId}" `);
@@ -292,7 +292,7 @@ describe('polling', () => {
292292
const output = execSync(
293293
`node pollDiscoveryOccurrenceFinished.js "${projectId}" "${resourceUrl}" "${timeoutSeconds}"`
294294
);
295-
assert.include(output, `Found discovery occurrence`);
295+
assert.include(output, 'Found discovery occurrence');
296296
});
297297
});
298298

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

380-
assert.include(empty, `Polled 0 occurrences`);
380+
assert.include(empty, 'Polled 0 occurrences');
381381
// create test occurrences
382382
for (let i = 0; i < expectedNum; i++) {
383383
const [

0 commit comments

Comments
 (0)