diff --git a/baselines/bigquery-storage/test/gapic_big_query_storage_v1beta1.ts.baseline b/baselines/bigquery-storage/test/gapic_big_query_storage_v1beta1.ts.baseline index 74ac30d97..2123078b5 100644 --- a/baselines/bigquery-storage/test/gapic_big_query_storage_v1beta1.ts.baseline +++ b/baselines/bigquery-storage/test/gapic_big_query_storage_v1beta1.ts.baseline @@ -219,7 +219,7 @@ describe('v1beta1.BigQueryStorageClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createReadSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createReadSession(request); }, expectedError); + await assert.rejects(async () => { await client.createReadSession(request); }, expectedError); assert((client.innerApiCalls.createReadSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -306,7 +306,7 @@ describe('v1beta1.BigQueryStorageClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.batchCreateReadSessionStreams(request); }, expectedError); + await assert.rejects(async () => { await client.batchCreateReadSessionStreams(request); }, expectedError); assert((client.innerApiCalls.batchCreateReadSessionStreams as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -393,7 +393,7 @@ describe('v1beta1.BigQueryStorageClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.finalizeStream = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.finalizeStream(request); }, expectedError); + await assert.rejects(async () => { await client.finalizeStream(request); }, expectedError); assert((client.innerApiCalls.finalizeStream as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -480,7 +480,7 @@ describe('v1beta1.BigQueryStorageClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.splitReadStream = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.splitReadStream(request); }, expectedError); + await assert.rejects(async () => { await client.splitReadStream(request); }, expectedError); assert((client.innerApiCalls.splitReadStream as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -551,7 +551,7 @@ describe('v1beta1.BigQueryStorageClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.readRows as SinonStub) .getCall(0).calledWith(request, expectedOptions)); }); diff --git a/baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline b/baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline index cff616f0c..3e8b2879a 100644 --- a/baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline +++ b/baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline @@ -268,7 +268,7 @@ describe('v1beta1.EchoClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.echo = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.echo(request); }, expectedError); + await assert.rejects(async () => { await client.echo(request); }, expectedError); assert((client.innerApiCalls.echo as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -328,7 +328,7 @@ describe('v1beta1.EchoClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.block = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.block(request); }, expectedError); + await assert.rejects(async () => { await client.block(request); }, expectedError); assert((client.innerApiCalls.block as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -392,7 +392,7 @@ describe('v1beta1.EchoClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.wait = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.wait(request); }, expectedError); + await assert.rejects(async () => { await client.wait(request); }, expectedError); assert((client.innerApiCalls.wait as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -408,7 +408,7 @@ describe('v1beta1.EchoClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.wait = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.wait(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.wait as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -459,7 +459,7 @@ describe('v1beta1.EchoClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.expand as SinonStub) .getCall(0).calledWith(request, expectedOptions)); }); @@ -513,7 +513,7 @@ describe('v1beta1.EchoClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.chat as SinonStub) .getCall(0).calledWithExactly(undefined)); assert.deepStrictEqual(((stream as unknown as PassThrough) @@ -573,7 +573,7 @@ describe('v1beta1.EchoClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.collect as SinonStub) .getCall(0).calledWith(null, {} /*, callback defined above */)); }); @@ -641,7 +641,7 @@ describe('v1beta1.EchoClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.pagedExpand = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.pagedExpand(request); }, expectedError); + await assert.rejects(async () => { await client.pagedExpand(request); }, expectedError); assert((client.innerApiCalls.pagedExpand as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -700,7 +700,7 @@ describe('v1beta1.EchoClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.pagedExpand.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.pagedExpand, request)); }); @@ -737,7 +737,7 @@ describe('v1beta1.EchoClient', () => { const request = generateSampleMessage(new protos.google.showcase.v1beta1.PagedExpandRequest());const expectedError = new Error('expected'); client.descriptors.page.pagedExpand.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.pagedExpandAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.IEchoResponse[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/disable-packing-test/test/gapic_identity_v1beta1.ts.baseline b/baselines/disable-packing-test/test/gapic_identity_v1beta1.ts.baseline index 5c6eb6ace..2318f351a 100644 --- a/baselines/disable-packing-test/test/gapic_identity_v1beta1.ts.baseline +++ b/baselines/disable-packing-test/test/gapic_identity_v1beta1.ts.baseline @@ -219,7 +219,7 @@ describe('v1beta1.IdentityClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createUser(request); }, expectedError); + await assert.rejects(async () => { await client.createUser(request); }, expectedError); assert((client.innerApiCalls.createUser as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -303,7 +303,7 @@ describe('v1beta1.IdentityClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getUser(request); }, expectedError); + await assert.rejects(async () => { await client.getUser(request); }, expectedError); assert((client.innerApiCalls.getUser as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -390,7 +390,7 @@ describe('v1beta1.IdentityClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateUser(request); }, expectedError); + await assert.rejects(async () => { await client.updateUser(request); }, expectedError); assert((client.innerApiCalls.updateUser as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -474,7 +474,7 @@ describe('v1beta1.IdentityClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteUser(request); }, expectedError); + await assert.rejects(async () => { await client.deleteUser(request); }, expectedError); assert((client.innerApiCalls.deleteUser as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -542,7 +542,7 @@ describe('v1beta1.IdentityClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listUsers(request); }, expectedError); + await assert.rejects(async () => { await client.listUsers(request); }, expectedError); assert((client.innerApiCalls.listUsers as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -601,7 +601,7 @@ describe('v1beta1.IdentityClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); }); @@ -638,7 +638,7 @@ describe('v1beta1.IdentityClient', () => { const request = generateSampleMessage(new protos.google.showcase.v1beta1.ListUsersRequest());const expectedError = new Error('expected'); client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listUsersAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.IUser[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline b/baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline index 184156ed4..6511f45aa 100644 --- a/baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline +++ b/baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline @@ -268,7 +268,7 @@ describe('v1beta1.MessagingClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.createRoom = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createRoom(request); }, expectedError); + await assert.rejects(async () => { await client.createRoom(request); }, expectedError); assert((client.innerApiCalls.createRoom as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -352,7 +352,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getRoom = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getRoom(request); }, expectedError); + await assert.rejects(async () => { await client.getRoom(request); }, expectedError); assert((client.innerApiCalls.getRoom as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -439,7 +439,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateRoom = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateRoom(request); }, expectedError); + await assert.rejects(async () => { await client.updateRoom(request); }, expectedError); assert((client.innerApiCalls.updateRoom as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -523,7 +523,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteRoom = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteRoom(request); }, expectedError); + await assert.rejects(async () => { await client.deleteRoom(request); }, expectedError); assert((client.innerApiCalls.deleteRoom as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -607,7 +607,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createBlurb = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createBlurb(request); }, expectedError); + await assert.rejects(async () => { await client.createBlurb(request); }, expectedError); assert((client.innerApiCalls.createBlurb as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -691,7 +691,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getBlurb = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getBlurb(request); }, expectedError); + await assert.rejects(async () => { await client.getBlurb(request); }, expectedError); assert((client.innerApiCalls.getBlurb as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -778,7 +778,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateBlurb = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateBlurb(request); }, expectedError); + await assert.rejects(async () => { await client.updateBlurb(request); }, expectedError); assert((client.innerApiCalls.updateBlurb as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -862,7 +862,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteBlurb = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteBlurb(request); }, expectedError); + await assert.rejects(async () => { await client.deleteBlurb(request); }, expectedError); assert((client.innerApiCalls.deleteBlurb as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -950,7 +950,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.searchBlurbs = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.searchBlurbs(request); }, expectedError); + await assert.rejects(async () => { await client.searchBlurbs(request); }, expectedError); assert((client.innerApiCalls.searchBlurbs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -974,7 +974,7 @@ describe('v1beta1.MessagingClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.searchBlurbs = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.searchBlurbs(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.searchBlurbs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1041,7 +1041,7 @@ describe('v1beta1.MessagingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.streamBlurbs as SinonStub) .getCall(0).calledWith(request, expectedOptions)); }); @@ -1095,7 +1095,7 @@ describe('v1beta1.MessagingClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.connect as SinonStub) .getCall(0).calledWithExactly(undefined)); assert.deepStrictEqual(((stream as unknown as PassThrough) @@ -1155,7 +1155,7 @@ describe('v1beta1.MessagingClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.sendBlurbs as SinonStub) .getCall(0).calledWith(null, {} /*, callback defined above */)); }); @@ -1223,7 +1223,7 @@ describe('v1beta1.MessagingClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listRooms = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listRooms(request); }, expectedError); + await assert.rejects(async () => { await client.listRooms(request); }, expectedError); assert((client.innerApiCalls.listRooms as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1282,7 +1282,7 @@ describe('v1beta1.MessagingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listRooms.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listRooms, request)); }); @@ -1319,7 +1319,7 @@ describe('v1beta1.MessagingClient', () => { const request = generateSampleMessage(new protos.google.showcase.v1beta1.ListRoomsRequest());const expectedError = new Error('expected'); client.descriptors.page.listRooms.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listRoomsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.IRoom[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1417,7 +1417,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listBlurbs = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listBlurbs(request); }, expectedError); + await assert.rejects(async () => { await client.listBlurbs(request); }, expectedError); assert((client.innerApiCalls.listBlurbs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1485,7 +1485,7 @@ describe('v1beta1.MessagingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listBlurbs.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listBlurbs, request)); assert.strictEqual( @@ -1536,7 +1536,7 @@ describe('v1beta1.MessagingClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listBlurbs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listBlurbsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.IBlurb[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/disable-packing-test/test/gapic_testing_v1beta1.ts.baseline b/baselines/disable-packing-test/test/gapic_testing_v1beta1.ts.baseline index 8c434c389..e3447cbff 100644 --- a/baselines/disable-packing-test/test/gapic_testing_v1beta1.ts.baseline +++ b/baselines/disable-packing-test/test/gapic_testing_v1beta1.ts.baseline @@ -219,7 +219,7 @@ describe('v1beta1.TestingClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.createSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createSession(request); }, expectedError); + await assert.rejects(async () => { await client.createSession(request); }, expectedError); assert((client.innerApiCalls.createSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -303,7 +303,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getSession(request); }, expectedError); + await assert.rejects(async () => { await client.getSession(request); }, expectedError); assert((client.innerApiCalls.getSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -387,7 +387,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteSession(request); }, expectedError); + await assert.rejects(async () => { await client.deleteSession(request); }, expectedError); assert((client.innerApiCalls.deleteSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -471,7 +471,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.reportSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.reportSession(request); }, expectedError); + await assert.rejects(async () => { await client.reportSession(request); }, expectedError); assert((client.innerApiCalls.reportSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -555,7 +555,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteTest = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteTest(request); }, expectedError); + await assert.rejects(async () => { await client.deleteTest(request); }, expectedError); assert((client.innerApiCalls.deleteTest as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -639,7 +639,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.verifyTest = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.verifyTest(request); }, expectedError); + await assert.rejects(async () => { await client.verifyTest(request); }, expectedError); assert((client.innerApiCalls.verifyTest as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -707,7 +707,7 @@ describe('v1beta1.TestingClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listSessions = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listSessions(request); }, expectedError); + await assert.rejects(async () => { await client.listSessions(request); }, expectedError); assert((client.innerApiCalls.listSessions as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -766,7 +766,7 @@ describe('v1beta1.TestingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listSessions.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); }); @@ -803,7 +803,7 @@ describe('v1beta1.TestingClient', () => { const request = generateSampleMessage(new protos.google.showcase.v1beta1.ListSessionsRequest());const expectedError = new Error('expected'); client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listSessionsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.ISession[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -901,7 +901,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listTests = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listTests(request); }, expectedError); + await assert.rejects(async () => { await client.listTests(request); }, expectedError); assert((client.innerApiCalls.listTests as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -969,7 +969,7 @@ describe('v1beta1.TestingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listTests.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listTests, request)); assert.strictEqual( @@ -1020,7 +1020,7 @@ describe('v1beta1.TestingClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listTests.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listTestsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.ITest[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/dlp/test/gapic_dlp_service_v2.ts.baseline b/baselines/dlp/test/gapic_dlp_service_v2.ts.baseline index cc069be9e..31c5617a3 100644 --- a/baselines/dlp/test/gapic_dlp_service_v2.ts.baseline +++ b/baselines/dlp/test/gapic_dlp_service_v2.ts.baseline @@ -243,7 +243,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.inspectContent = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.inspectContent(request); }, expectedError); + await assert.rejects(async () => { await client.inspectContent(request); }, expectedError); assert((client.innerApiCalls.inspectContent as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.redactImage = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.redactImage(request); }, expectedError); + await assert.rejects(async () => { await client.redactImage(request); }, expectedError); assert((client.innerApiCalls.redactImage as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -411,7 +411,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deidentifyContent = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deidentifyContent(request); }, expectedError); + await assert.rejects(async () => { await client.deidentifyContent(request); }, expectedError); assert((client.innerApiCalls.deidentifyContent as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -495,7 +495,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.reidentifyContent = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.reidentifyContent(request); }, expectedError); + await assert.rejects(async () => { await client.reidentifyContent(request); }, expectedError); assert((client.innerApiCalls.reidentifyContent as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -555,7 +555,7 @@ describe('v2.DlpServiceClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listInfoTypes = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listInfoTypes(request); }, expectedError); + await assert.rejects(async () => { await client.listInfoTypes(request); }, expectedError); assert((client.innerApiCalls.listInfoTypes as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -639,7 +639,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createInspectTemplate = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createInspectTemplate(request); }, expectedError); + await assert.rejects(async () => { await client.createInspectTemplate(request); }, expectedError); assert((client.innerApiCalls.createInspectTemplate as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -723,7 +723,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateInspectTemplate = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateInspectTemplate(request); }, expectedError); + await assert.rejects(async () => { await client.updateInspectTemplate(request); }, expectedError); assert((client.innerApiCalls.updateInspectTemplate as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -807,7 +807,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getInspectTemplate = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getInspectTemplate(request); }, expectedError); + await assert.rejects(async () => { await client.getInspectTemplate(request); }, expectedError); assert((client.innerApiCalls.getInspectTemplate as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -891,7 +891,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteInspectTemplate = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteInspectTemplate(request); }, expectedError); + await assert.rejects(async () => { await client.deleteInspectTemplate(request); }, expectedError); assert((client.innerApiCalls.deleteInspectTemplate as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -975,7 +975,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createDeidentifyTemplate = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createDeidentifyTemplate(request); }, expectedError); + await assert.rejects(async () => { await client.createDeidentifyTemplate(request); }, expectedError); assert((client.innerApiCalls.createDeidentifyTemplate as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1059,7 +1059,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateDeidentifyTemplate = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateDeidentifyTemplate(request); }, expectedError); + await assert.rejects(async () => { await client.updateDeidentifyTemplate(request); }, expectedError); assert((client.innerApiCalls.updateDeidentifyTemplate as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1143,7 +1143,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getDeidentifyTemplate = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getDeidentifyTemplate(request); }, expectedError); + await assert.rejects(async () => { await client.getDeidentifyTemplate(request); }, expectedError); assert((client.innerApiCalls.getDeidentifyTemplate as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1227,7 +1227,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteDeidentifyTemplate = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteDeidentifyTemplate(request); }, expectedError); + await assert.rejects(async () => { await client.deleteDeidentifyTemplate(request); }, expectedError); assert((client.innerApiCalls.deleteDeidentifyTemplate as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1311,7 +1311,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createJobTrigger = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createJobTrigger(request); }, expectedError); + await assert.rejects(async () => { await client.createJobTrigger(request); }, expectedError); assert((client.innerApiCalls.createJobTrigger as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1395,7 +1395,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateJobTrigger = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateJobTrigger(request); }, expectedError); + await assert.rejects(async () => { await client.updateJobTrigger(request); }, expectedError); assert((client.innerApiCalls.updateJobTrigger as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1479,7 +1479,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getJobTrigger = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getJobTrigger(request); }, expectedError); + await assert.rejects(async () => { await client.getJobTrigger(request); }, expectedError); assert((client.innerApiCalls.getJobTrigger as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1563,7 +1563,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteJobTrigger = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteJobTrigger(request); }, expectedError); + await assert.rejects(async () => { await client.deleteJobTrigger(request); }, expectedError); assert((client.innerApiCalls.deleteJobTrigger as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1647,7 +1647,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.activateJobTrigger = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.activateJobTrigger(request); }, expectedError); + await assert.rejects(async () => { await client.activateJobTrigger(request); }, expectedError); assert((client.innerApiCalls.activateJobTrigger as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1731,7 +1731,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createDlpJob = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createDlpJob(request); }, expectedError); + await assert.rejects(async () => { await client.createDlpJob(request); }, expectedError); assert((client.innerApiCalls.createDlpJob as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1815,7 +1815,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getDlpJob = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getDlpJob(request); }, expectedError); + await assert.rejects(async () => { await client.getDlpJob(request); }, expectedError); assert((client.innerApiCalls.getDlpJob as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1899,7 +1899,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteDlpJob = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteDlpJob(request); }, expectedError); + await assert.rejects(async () => { await client.deleteDlpJob(request); }, expectedError); assert((client.innerApiCalls.deleteDlpJob as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1983,7 +1983,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.cancelDlpJob = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.cancelDlpJob(request); }, expectedError); + await assert.rejects(async () => { await client.cancelDlpJob(request); }, expectedError); assert((client.innerApiCalls.cancelDlpJob as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2067,7 +2067,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createStoredInfoType = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createStoredInfoType(request); }, expectedError); + await assert.rejects(async () => { await client.createStoredInfoType(request); }, expectedError); assert((client.innerApiCalls.createStoredInfoType as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2151,7 +2151,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateStoredInfoType = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateStoredInfoType(request); }, expectedError); + await assert.rejects(async () => { await client.updateStoredInfoType(request); }, expectedError); assert((client.innerApiCalls.updateStoredInfoType as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2235,7 +2235,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getStoredInfoType = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getStoredInfoType(request); }, expectedError); + await assert.rejects(async () => { await client.getStoredInfoType(request); }, expectedError); assert((client.innerApiCalls.getStoredInfoType as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2319,7 +2319,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteStoredInfoType = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteStoredInfoType(request); }, expectedError); + await assert.rejects(async () => { await client.deleteStoredInfoType(request); }, expectedError); assert((client.innerApiCalls.deleteStoredInfoType as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2411,7 +2411,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listInspectTemplates = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listInspectTemplates(request); }, expectedError); + await assert.rejects(async () => { await client.listInspectTemplates(request); }, expectedError); assert((client.innerApiCalls.listInspectTemplates as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2479,7 +2479,7 @@ describe('v2.DlpServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listInspectTemplates.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listInspectTemplates, request)); assert.strictEqual( @@ -2530,7 +2530,7 @@ describe('v2.DlpServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listInspectTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listInspectTemplatesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.privacy.dlp.v2.IInspectTemplate[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2633,7 +2633,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listDeidentifyTemplates = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listDeidentifyTemplates(request); }, expectedError); + await assert.rejects(async () => { await client.listDeidentifyTemplates(request); }, expectedError); assert((client.innerApiCalls.listDeidentifyTemplates as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2701,7 +2701,7 @@ describe('v2.DlpServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listDeidentifyTemplates.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listDeidentifyTemplates, request)); assert.strictEqual( @@ -2752,7 +2752,7 @@ describe('v2.DlpServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listDeidentifyTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listDeidentifyTemplatesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.privacy.dlp.v2.IDeidentifyTemplate[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2855,7 +2855,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listJobTriggers = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listJobTriggers(request); }, expectedError); + await assert.rejects(async () => { await client.listJobTriggers(request); }, expectedError); assert((client.innerApiCalls.listJobTriggers as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2923,7 +2923,7 @@ describe('v2.DlpServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listJobTriggers.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listJobTriggers, request)); assert.strictEqual( @@ -2974,7 +2974,7 @@ describe('v2.DlpServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listJobTriggers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listJobTriggersAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.privacy.dlp.v2.IJobTrigger[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3077,7 +3077,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listDlpJobs = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listDlpJobs(request); }, expectedError); + await assert.rejects(async () => { await client.listDlpJobs(request); }, expectedError); assert((client.innerApiCalls.listDlpJobs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -3145,7 +3145,7 @@ describe('v2.DlpServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listDlpJobs.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listDlpJobs, request)); assert.strictEqual( @@ -3196,7 +3196,7 @@ describe('v2.DlpServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listDlpJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listDlpJobsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.privacy.dlp.v2.IDlpJob[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3299,7 +3299,7 @@ describe('v2.DlpServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listStoredInfoTypes = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listStoredInfoTypes(request); }, expectedError); + await assert.rejects(async () => { await client.listStoredInfoTypes(request); }, expectedError); assert((client.innerApiCalls.listStoredInfoTypes as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -3367,7 +3367,7 @@ describe('v2.DlpServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listStoredInfoTypes.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listStoredInfoTypes, request)); assert.strictEqual( @@ -3418,7 +3418,7 @@ describe('v2.DlpServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listStoredInfoTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listStoredInfoTypesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.privacy.dlp.v2.IStoredInfoType[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/kms/test/gapic_key_management_service_v1.ts.baseline b/baselines/kms/test/gapic_key_management_service_v1.ts.baseline index a0fb18587..9c99fa158 100644 --- a/baselines/kms/test/gapic_key_management_service_v1.ts.baseline +++ b/baselines/kms/test/gapic_key_management_service_v1.ts.baseline @@ -243,7 +243,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getKeyRing = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getKeyRing(request); }, expectedError); + await assert.rejects(async () => { await client.getKeyRing(request); }, expectedError); assert((client.innerApiCalls.getKeyRing as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getCryptoKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getCryptoKey(request); }, expectedError); + await assert.rejects(async () => { await client.getCryptoKey(request); }, expectedError); assert((client.innerApiCalls.getCryptoKey as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -411,7 +411,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getCryptoKeyVersion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getCryptoKeyVersion(request); }, expectedError); + await assert.rejects(async () => { await client.getCryptoKeyVersion(request); }, expectedError); assert((client.innerApiCalls.getCryptoKeyVersion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -495,7 +495,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getPublicKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getPublicKey(request); }, expectedError); + await assert.rejects(async () => { await client.getPublicKey(request); }, expectedError); assert((client.innerApiCalls.getPublicKey as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -579,7 +579,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getImportJob = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getImportJob(request); }, expectedError); + await assert.rejects(async () => { await client.getImportJob(request); }, expectedError); assert((client.innerApiCalls.getImportJob as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -663,7 +663,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createKeyRing = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createKeyRing(request); }, expectedError); + await assert.rejects(async () => { await client.createKeyRing(request); }, expectedError); assert((client.innerApiCalls.createKeyRing as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -747,7 +747,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createCryptoKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createCryptoKey(request); }, expectedError); + await assert.rejects(async () => { await client.createCryptoKey(request); }, expectedError); assert((client.innerApiCalls.createCryptoKey as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -831,7 +831,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createCryptoKeyVersion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createCryptoKeyVersion(request); }, expectedError); + await assert.rejects(async () => { await client.createCryptoKeyVersion(request); }, expectedError); assert((client.innerApiCalls.createCryptoKeyVersion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -915,7 +915,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.importCryptoKeyVersion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.importCryptoKeyVersion(request); }, expectedError); + await assert.rejects(async () => { await client.importCryptoKeyVersion(request); }, expectedError); assert((client.innerApiCalls.importCryptoKeyVersion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -999,7 +999,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createImportJob = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createImportJob(request); }, expectedError); + await assert.rejects(async () => { await client.createImportJob(request); }, expectedError); assert((client.innerApiCalls.createImportJob as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1086,7 +1086,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateCryptoKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateCryptoKey(request); }, expectedError); + await assert.rejects(async () => { await client.updateCryptoKey(request); }, expectedError); assert((client.innerApiCalls.updateCryptoKey as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1173,7 +1173,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateCryptoKeyVersion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateCryptoKeyVersion(request); }, expectedError); + await assert.rejects(async () => { await client.updateCryptoKeyVersion(request); }, expectedError); assert((client.innerApiCalls.updateCryptoKeyVersion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1257,7 +1257,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.encrypt = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.encrypt(request); }, expectedError); + await assert.rejects(async () => { await client.encrypt(request); }, expectedError); assert((client.innerApiCalls.encrypt as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1341,7 +1341,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.decrypt = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.decrypt(request); }, expectedError); + await assert.rejects(async () => { await client.decrypt(request); }, expectedError); assert((client.innerApiCalls.decrypt as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1425,7 +1425,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.asymmetricSign = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.asymmetricSign(request); }, expectedError); + await assert.rejects(async () => { await client.asymmetricSign(request); }, expectedError); assert((client.innerApiCalls.asymmetricSign as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1509,7 +1509,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.asymmetricDecrypt = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.asymmetricDecrypt(request); }, expectedError); + await assert.rejects(async () => { await client.asymmetricDecrypt(request); }, expectedError); assert((client.innerApiCalls.asymmetricDecrypt as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1593,7 +1593,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateCryptoKeyPrimaryVersion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateCryptoKeyPrimaryVersion(request); }, expectedError); + await assert.rejects(async () => { await client.updateCryptoKeyPrimaryVersion(request); }, expectedError); assert((client.innerApiCalls.updateCryptoKeyPrimaryVersion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1677,7 +1677,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.destroyCryptoKeyVersion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.destroyCryptoKeyVersion(request); }, expectedError); + await assert.rejects(async () => { await client.destroyCryptoKeyVersion(request); }, expectedError); assert((client.innerApiCalls.destroyCryptoKeyVersion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1761,7 +1761,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.restoreCryptoKeyVersion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.restoreCryptoKeyVersion(request); }, expectedError); + await assert.rejects(async () => { await client.restoreCryptoKeyVersion(request); }, expectedError); assert((client.innerApiCalls.restoreCryptoKeyVersion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1853,7 +1853,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listKeyRings = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listKeyRings(request); }, expectedError); + await assert.rejects(async () => { await client.listKeyRings(request); }, expectedError); assert((client.innerApiCalls.listKeyRings as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1921,7 +1921,7 @@ describe('v1.KeyManagementServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listKeyRings.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listKeyRings, request)); assert.strictEqual( @@ -1972,7 +1972,7 @@ describe('v1.KeyManagementServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listKeyRings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listKeyRingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.kms.v1.IKeyRing[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2075,7 +2075,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listCryptoKeys = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listCryptoKeys(request); }, expectedError); + await assert.rejects(async () => { await client.listCryptoKeys(request); }, expectedError); assert((client.innerApiCalls.listCryptoKeys as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2143,7 +2143,7 @@ describe('v1.KeyManagementServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listCryptoKeys.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listCryptoKeys, request)); assert.strictEqual( @@ -2194,7 +2194,7 @@ describe('v1.KeyManagementServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listCryptoKeys.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listCryptoKeysAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.kms.v1.ICryptoKey[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2297,7 +2297,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listCryptoKeyVersions = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listCryptoKeyVersions(request); }, expectedError); + await assert.rejects(async () => { await client.listCryptoKeyVersions(request); }, expectedError); assert((client.innerApiCalls.listCryptoKeyVersions as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2365,7 +2365,7 @@ describe('v1.KeyManagementServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listCryptoKeyVersions.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listCryptoKeyVersions, request)); assert.strictEqual( @@ -2416,7 +2416,7 @@ describe('v1.KeyManagementServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listCryptoKeyVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listCryptoKeyVersionsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.kms.v1.ICryptoKeyVersion[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2519,7 +2519,7 @@ describe('v1.KeyManagementServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listImportJobs = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listImportJobs(request); }, expectedError); + await assert.rejects(async () => { await client.listImportJobs(request); }, expectedError); assert((client.innerApiCalls.listImportJobs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -2587,7 +2587,7 @@ describe('v1.KeyManagementServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listImportJobs.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listImportJobs, request)); assert.strictEqual( @@ -2638,7 +2638,7 @@ describe('v1.KeyManagementServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listImportJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listImportJobsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.kms.v1.IImportJob[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/logging/test/gapic_config_service_v2_v2.ts.baseline b/baselines/logging/test/gapic_config_service_v2_v2.ts.baseline index cbee78efb..cc395b112 100644 --- a/baselines/logging/test/gapic_config_service_v2_v2.ts.baseline +++ b/baselines/logging/test/gapic_config_service_v2_v2.ts.baseline @@ -243,7 +243,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getBucket = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getBucket(request); }, expectedError); + await assert.rejects(async () => { await client.getBucket(request); }, expectedError); assert((client.innerApiCalls.getBucket as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateBucket = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateBucket(request); }, expectedError); + await assert.rejects(async () => { await client.updateBucket(request); }, expectedError); assert((client.innerApiCalls.updateBucket as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -411,7 +411,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSink = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getSink(request); }, expectedError); + await assert.rejects(async () => { await client.getSink(request); }, expectedError); assert((client.innerApiCalls.getSink as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -495,7 +495,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createSink = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createSink(request); }, expectedError); + await assert.rejects(async () => { await client.createSink(request); }, expectedError); assert((client.innerApiCalls.createSink as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -579,7 +579,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateSink = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateSink(request); }, expectedError); + await assert.rejects(async () => { await client.updateSink(request); }, expectedError); assert((client.innerApiCalls.updateSink as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -663,7 +663,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteSink = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteSink(request); }, expectedError); + await assert.rejects(async () => { await client.deleteSink(request); }, expectedError); assert((client.innerApiCalls.deleteSink as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -747,7 +747,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getExclusion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getExclusion(request); }, expectedError); + await assert.rejects(async () => { await client.getExclusion(request); }, expectedError); assert((client.innerApiCalls.getExclusion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -831,7 +831,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createExclusion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createExclusion(request); }, expectedError); + await assert.rejects(async () => { await client.createExclusion(request); }, expectedError); assert((client.innerApiCalls.createExclusion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -915,7 +915,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateExclusion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateExclusion(request); }, expectedError); + await assert.rejects(async () => { await client.updateExclusion(request); }, expectedError); assert((client.innerApiCalls.updateExclusion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -999,7 +999,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteExclusion = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteExclusion(request); }, expectedError); + await assert.rejects(async () => { await client.deleteExclusion(request); }, expectedError); assert((client.innerApiCalls.deleteExclusion as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1083,7 +1083,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getCmekSettings = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getCmekSettings(request); }, expectedError); + await assert.rejects(async () => { await client.getCmekSettings(request); }, expectedError); assert((client.innerApiCalls.getCmekSettings as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1167,7 +1167,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateCmekSettings = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateCmekSettings(request); }, expectedError); + await assert.rejects(async () => { await client.updateCmekSettings(request); }, expectedError); assert((client.innerApiCalls.updateCmekSettings as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1259,7 +1259,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listBuckets = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listBuckets(request); }, expectedError); + await assert.rejects(async () => { await client.listBuckets(request); }, expectedError); assert((client.innerApiCalls.listBuckets as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1327,7 +1327,7 @@ describe('v2.ConfigServiceV2Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listBuckets.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listBuckets, request)); assert.strictEqual( @@ -1378,7 +1378,7 @@ describe('v2.ConfigServiceV2Client', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listBuckets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listBucketsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.logging.v2.ILogBucket[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1481,7 +1481,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listSinks = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listSinks(request); }, expectedError); + await assert.rejects(async () => { await client.listSinks(request); }, expectedError); assert((client.innerApiCalls.listSinks as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1549,7 +1549,7 @@ describe('v2.ConfigServiceV2Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listSinks.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listSinks, request)); assert.strictEqual( @@ -1600,7 +1600,7 @@ describe('v2.ConfigServiceV2Client', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listSinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listSinksAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.logging.v2.ILogSink[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1703,7 +1703,7 @@ describe('v2.ConfigServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listExclusions = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listExclusions(request); }, expectedError); + await assert.rejects(async () => { await client.listExclusions(request); }, expectedError); assert((client.innerApiCalls.listExclusions as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1771,7 +1771,7 @@ describe('v2.ConfigServiceV2Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listExclusions.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listExclusions, request)); assert.strictEqual( @@ -1822,7 +1822,7 @@ describe('v2.ConfigServiceV2Client', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listExclusions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listExclusionsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.logging.v2.ILogExclusion[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline b/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline index 25d6631ff..9758a30cc 100644 --- a/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline +++ b/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline @@ -243,7 +243,7 @@ describe('v2.LoggingServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteLog = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteLog(request); }, expectedError); + await assert.rejects(async () => { await client.deleteLog(request); }, expectedError); assert((client.innerApiCalls.deleteLog as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -303,7 +303,7 @@ describe('v2.LoggingServiceV2Client', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.writeLogEntries = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.writeLogEntries(request); }, expectedError); + await assert.rejects(async () => { await client.writeLogEntries(request); }, expectedError); assert((client.innerApiCalls.writeLogEntries as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -371,7 +371,7 @@ describe('v2.LoggingServiceV2Client', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listLogEntries = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listLogEntries(request); }, expectedError); + await assert.rejects(async () => { await client.listLogEntries(request); }, expectedError); assert((client.innerApiCalls.listLogEntries as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -430,7 +430,7 @@ describe('v2.LoggingServiceV2Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listLogEntries.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listLogEntries, request)); }); @@ -467,7 +467,7 @@ describe('v2.LoggingServiceV2Client', () => { const request = generateSampleMessage(new protos.google.logging.v2.ListLogEntriesRequest());const expectedError = new Error('expected'); client.descriptors.page.listLogEntries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listLogEntriesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.logging.v2.ILogEntry[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -541,7 +541,7 @@ describe('v2.LoggingServiceV2Client', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listMonitoredResourceDescriptors = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listMonitoredResourceDescriptors(request); }, expectedError); + await assert.rejects(async () => { await client.listMonitoredResourceDescriptors(request); }, expectedError); assert((client.innerApiCalls.listMonitoredResourceDescriptors as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -600,7 +600,7 @@ describe('v2.LoggingServiceV2Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listMonitoredResourceDescriptors.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listMonitoredResourceDescriptors, request)); }); @@ -637,7 +637,7 @@ describe('v2.LoggingServiceV2Client', () => { const request = generateSampleMessage(new protos.google.logging.v2.ListMonitoredResourceDescriptorsRequest());const expectedError = new Error('expected'); client.descriptors.page.listMonitoredResourceDescriptors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listMonitoredResourceDescriptorsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.api.IMonitoredResourceDescriptor[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -727,7 +727,7 @@ describe('v2.LoggingServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listLogs = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listLogs(request); }, expectedError); + await assert.rejects(async () => { await client.listLogs(request); }, expectedError); assert((client.innerApiCalls.listLogs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -791,7 +791,7 @@ describe('v2.LoggingServiceV2Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listLogs.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listLogs, request)); assert.strictEqual( @@ -838,7 +838,7 @@ describe('v2.LoggingServiceV2Client', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listLogs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listLogsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: string[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline b/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline index 7a2bb9091..0b6050e0a 100644 --- a/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline +++ b/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline @@ -243,7 +243,7 @@ describe('v2.MetricsServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getLogMetric = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getLogMetric(request); }, expectedError); + await assert.rejects(async () => { await client.getLogMetric(request); }, expectedError); assert((client.innerApiCalls.getLogMetric as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v2.MetricsServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createLogMetric = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createLogMetric(request); }, expectedError); + await assert.rejects(async () => { await client.createLogMetric(request); }, expectedError); assert((client.innerApiCalls.createLogMetric as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -411,7 +411,7 @@ describe('v2.MetricsServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateLogMetric = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateLogMetric(request); }, expectedError); + await assert.rejects(async () => { await client.updateLogMetric(request); }, expectedError); assert((client.innerApiCalls.updateLogMetric as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -495,7 +495,7 @@ describe('v2.MetricsServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteLogMetric = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteLogMetric(request); }, expectedError); + await assert.rejects(async () => { await client.deleteLogMetric(request); }, expectedError); assert((client.innerApiCalls.deleteLogMetric as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -587,7 +587,7 @@ describe('v2.MetricsServiceV2Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listLogMetrics = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listLogMetrics(request); }, expectedError); + await assert.rejects(async () => { await client.listLogMetrics(request); }, expectedError); assert((client.innerApiCalls.listLogMetrics as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -655,7 +655,7 @@ describe('v2.MetricsServiceV2Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listLogMetrics.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listLogMetrics, request)); assert.strictEqual( @@ -706,7 +706,7 @@ describe('v2.MetricsServiceV2Client', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listLogMetrics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listLogMetricsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.logging.v2.ILogMetric[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline b/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline index 3efdf1820..47f4e0f77 100644 --- a/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline @@ -243,7 +243,7 @@ describe('v3.AlertPolicyServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getAlertPolicy = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getAlertPolicy(request); }, expectedError); + await assert.rejects(async () => { await client.getAlertPolicy(request); }, expectedError); assert((client.innerApiCalls.getAlertPolicy as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v3.AlertPolicyServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createAlertPolicy = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createAlertPolicy(request); }, expectedError); + await assert.rejects(async () => { await client.createAlertPolicy(request); }, expectedError); assert((client.innerApiCalls.createAlertPolicy as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -411,7 +411,7 @@ describe('v3.AlertPolicyServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteAlertPolicy = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteAlertPolicy(request); }, expectedError); + await assert.rejects(async () => { await client.deleteAlertPolicy(request); }, expectedError); assert((client.innerApiCalls.deleteAlertPolicy as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -498,7 +498,7 @@ describe('v3.AlertPolicyServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateAlertPolicy = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateAlertPolicy(request); }, expectedError); + await assert.rejects(async () => { await client.updateAlertPolicy(request); }, expectedError); assert((client.innerApiCalls.updateAlertPolicy as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -590,7 +590,7 @@ describe('v3.AlertPolicyServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listAlertPolicies = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listAlertPolicies(request); }, expectedError); + await assert.rejects(async () => { await client.listAlertPolicies(request); }, expectedError); assert((client.innerApiCalls.listAlertPolicies as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -658,7 +658,7 @@ describe('v3.AlertPolicyServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listAlertPolicies.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listAlertPolicies, request)); assert.strictEqual( @@ -709,7 +709,7 @@ describe('v3.AlertPolicyServiceClient', () => { const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); client.descriptors.page.listAlertPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listAlertPoliciesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IAlertPolicy[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/monitoring/test/gapic_group_service_v3.ts.baseline b/baselines/monitoring/test/gapic_group_service_v3.ts.baseline index 22622930c..e02b755dc 100644 --- a/baselines/monitoring/test/gapic_group_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_group_service_v3.ts.baseline @@ -243,7 +243,7 @@ describe('v3.GroupServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getGroup = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getGroup(request); }, expectedError); + await assert.rejects(async () => { await client.getGroup(request); }, expectedError); assert((client.innerApiCalls.getGroup as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v3.GroupServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createGroup = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createGroup(request); }, expectedError); + await assert.rejects(async () => { await client.createGroup(request); }, expectedError); assert((client.innerApiCalls.createGroup as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -414,7 +414,7 @@ describe('v3.GroupServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateGroup = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateGroup(request); }, expectedError); + await assert.rejects(async () => { await client.updateGroup(request); }, expectedError); assert((client.innerApiCalls.updateGroup as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -498,7 +498,7 @@ describe('v3.GroupServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteGroup = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteGroup(request); }, expectedError); + await assert.rejects(async () => { await client.deleteGroup(request); }, expectedError); assert((client.innerApiCalls.deleteGroup as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -590,7 +590,7 @@ describe('v3.GroupServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listGroups = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listGroups(request); }, expectedError); + await assert.rejects(async () => { await client.listGroups(request); }, expectedError); assert((client.innerApiCalls.listGroups as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -658,7 +658,7 @@ describe('v3.GroupServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listGroups.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listGroups, request)); assert.strictEqual( @@ -709,7 +709,7 @@ describe('v3.GroupServiceClient', () => { const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); client.descriptors.page.listGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listGroupsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IGroup[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -812,7 +812,7 @@ describe('v3.GroupServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listGroupMembers = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listGroupMembers(request); }, expectedError); + await assert.rejects(async () => { await client.listGroupMembers(request); }, expectedError); assert((client.innerApiCalls.listGroupMembers as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -880,7 +880,7 @@ describe('v3.GroupServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listGroupMembers.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listGroupMembers, request)); assert.strictEqual( @@ -931,7 +931,7 @@ describe('v3.GroupServiceClient', () => { const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); client.descriptors.page.listGroupMembers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listGroupMembersAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.api.IMonitoredResource[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/monitoring/test/gapic_metric_service_v3.ts.baseline b/baselines/monitoring/test/gapic_metric_service_v3.ts.baseline index bb7acc30e..2e7ed7aec 100644 --- a/baselines/monitoring/test/gapic_metric_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_metric_service_v3.ts.baseline @@ -243,7 +243,7 @@ describe('v3.MetricServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getMonitoredResourceDescriptor = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getMonitoredResourceDescriptor(request); }, expectedError); + await assert.rejects(async () => { await client.getMonitoredResourceDescriptor(request); }, expectedError); assert((client.innerApiCalls.getMonitoredResourceDescriptor as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v3.MetricServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getMetricDescriptor = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getMetricDescriptor(request); }, expectedError); + await assert.rejects(async () => { await client.getMetricDescriptor(request); }, expectedError); assert((client.innerApiCalls.getMetricDescriptor as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -411,7 +411,7 @@ describe('v3.MetricServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createMetricDescriptor = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createMetricDescriptor(request); }, expectedError); + await assert.rejects(async () => { await client.createMetricDescriptor(request); }, expectedError); assert((client.innerApiCalls.createMetricDescriptor as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -495,7 +495,7 @@ describe('v3.MetricServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteMetricDescriptor = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteMetricDescriptor(request); }, expectedError); + await assert.rejects(async () => { await client.deleteMetricDescriptor(request); }, expectedError); assert((client.innerApiCalls.deleteMetricDescriptor as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -579,7 +579,7 @@ describe('v3.MetricServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createTimeSeries = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createTimeSeries(request); }, expectedError); + await assert.rejects(async () => { await client.createTimeSeries(request); }, expectedError); assert((client.innerApiCalls.createTimeSeries as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -671,7 +671,7 @@ describe('v3.MetricServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listMonitoredResourceDescriptors = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listMonitoredResourceDescriptors(request); }, expectedError); + await assert.rejects(async () => { await client.listMonitoredResourceDescriptors(request); }, expectedError); assert((client.innerApiCalls.listMonitoredResourceDescriptors as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -739,7 +739,7 @@ describe('v3.MetricServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listMonitoredResourceDescriptors.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listMonitoredResourceDescriptors, request)); assert.strictEqual( @@ -790,7 +790,7 @@ describe('v3.MetricServiceClient', () => { const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); client.descriptors.page.listMonitoredResourceDescriptors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listMonitoredResourceDescriptorsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.api.IMonitoredResourceDescriptor[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -893,7 +893,7 @@ describe('v3.MetricServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listMetricDescriptors = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listMetricDescriptors(request); }, expectedError); + await assert.rejects(async () => { await client.listMetricDescriptors(request); }, expectedError); assert((client.innerApiCalls.listMetricDescriptors as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -961,7 +961,7 @@ describe('v3.MetricServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listMetricDescriptors.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listMetricDescriptors, request)); assert.strictEqual( @@ -1012,7 +1012,7 @@ describe('v3.MetricServiceClient', () => { const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); client.descriptors.page.listMetricDescriptors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listMetricDescriptorsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.api.IMetricDescriptor[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1115,7 +1115,7 @@ describe('v3.MetricServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listTimeSeries = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listTimeSeries(request); }, expectedError); + await assert.rejects(async () => { await client.listTimeSeries(request); }, expectedError); assert((client.innerApiCalls.listTimeSeries as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1183,7 +1183,7 @@ describe('v3.MetricServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listTimeSeries.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listTimeSeries, request)); assert.strictEqual( @@ -1234,7 +1234,7 @@ describe('v3.MetricServiceClient', () => { const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); client.descriptors.page.listTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listTimeSeriesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.ITimeSeries[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline b/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline index 1dd132fad..9fafadbbf 100644 --- a/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline @@ -243,7 +243,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getNotificationChannelDescriptor = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getNotificationChannelDescriptor(request); }, expectedError); + await assert.rejects(async () => { await client.getNotificationChannelDescriptor(request); }, expectedError); assert((client.innerApiCalls.getNotificationChannelDescriptor as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getNotificationChannel = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getNotificationChannel(request); }, expectedError); + await assert.rejects(async () => { await client.getNotificationChannel(request); }, expectedError); assert((client.innerApiCalls.getNotificationChannel as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -411,7 +411,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createNotificationChannel = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createNotificationChannel(request); }, expectedError); + await assert.rejects(async () => { await client.createNotificationChannel(request); }, expectedError); assert((client.innerApiCalls.createNotificationChannel as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -498,7 +498,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateNotificationChannel = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateNotificationChannel(request); }, expectedError); + await assert.rejects(async () => { await client.updateNotificationChannel(request); }, expectedError); assert((client.innerApiCalls.updateNotificationChannel as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -582,7 +582,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotificationChannel = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteNotificationChannel(request); }, expectedError); + await assert.rejects(async () => { await client.deleteNotificationChannel(request); }, expectedError); assert((client.innerApiCalls.deleteNotificationChannel as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -666,7 +666,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.sendNotificationChannelVerificationCode = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.sendNotificationChannelVerificationCode(request); }, expectedError); + await assert.rejects(async () => { await client.sendNotificationChannelVerificationCode(request); }, expectedError); assert((client.innerApiCalls.sendNotificationChannelVerificationCode as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -750,7 +750,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getNotificationChannelVerificationCode = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getNotificationChannelVerificationCode(request); }, expectedError); + await assert.rejects(async () => { await client.getNotificationChannelVerificationCode(request); }, expectedError); assert((client.innerApiCalls.getNotificationChannelVerificationCode as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -834,7 +834,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.verifyNotificationChannel = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.verifyNotificationChannel(request); }, expectedError); + await assert.rejects(async () => { await client.verifyNotificationChannel(request); }, expectedError); assert((client.innerApiCalls.verifyNotificationChannel as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -926,7 +926,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listNotificationChannelDescriptors = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listNotificationChannelDescriptors(request); }, expectedError); + await assert.rejects(async () => { await client.listNotificationChannelDescriptors(request); }, expectedError); assert((client.innerApiCalls.listNotificationChannelDescriptors as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -994,7 +994,7 @@ describe('v3.NotificationChannelServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listNotificationChannelDescriptors.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listNotificationChannelDescriptors, request)); assert.strictEqual( @@ -1045,7 +1045,7 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); client.descriptors.page.listNotificationChannelDescriptors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listNotificationChannelDescriptorsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.INotificationChannelDescriptor[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1148,7 +1148,7 @@ describe('v3.NotificationChannelServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listNotificationChannels = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listNotificationChannels(request); }, expectedError); + await assert.rejects(async () => { await client.listNotificationChannels(request); }, expectedError); assert((client.innerApiCalls.listNotificationChannels as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1216,7 +1216,7 @@ describe('v3.NotificationChannelServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listNotificationChannels.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listNotificationChannels, request)); assert.strictEqual( @@ -1267,7 +1267,7 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); client.descriptors.page.listNotificationChannels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listNotificationChannelsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.INotificationChannel[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline b/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline index 2a835162e..b12a1b709 100644 --- a/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline @@ -243,7 +243,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createService = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createService(request); }, expectedError); + await assert.rejects(async () => { await client.createService(request); }, expectedError); assert((client.innerApiCalls.createService as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getService = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getService(request); }, expectedError); + await assert.rejects(async () => { await client.getService(request); }, expectedError); assert((client.innerApiCalls.getService as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -414,7 +414,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateService = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateService(request); }, expectedError); + await assert.rejects(async () => { await client.updateService(request); }, expectedError); assert((client.innerApiCalls.updateService as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -498,7 +498,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteService = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteService(request); }, expectedError); + await assert.rejects(async () => { await client.deleteService(request); }, expectedError); assert((client.innerApiCalls.deleteService as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -582,7 +582,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createServiceLevelObjective = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createServiceLevelObjective(request); }, expectedError); + await assert.rejects(async () => { await client.createServiceLevelObjective(request); }, expectedError); assert((client.innerApiCalls.createServiceLevelObjective as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -666,7 +666,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getServiceLevelObjective = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getServiceLevelObjective(request); }, expectedError); + await assert.rejects(async () => { await client.getServiceLevelObjective(request); }, expectedError); assert((client.innerApiCalls.getServiceLevelObjective as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -753,7 +753,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateServiceLevelObjective = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateServiceLevelObjective(request); }, expectedError); + await assert.rejects(async () => { await client.updateServiceLevelObjective(request); }, expectedError); assert((client.innerApiCalls.updateServiceLevelObjective as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -837,7 +837,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteServiceLevelObjective = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteServiceLevelObjective(request); }, expectedError); + await assert.rejects(async () => { await client.deleteServiceLevelObjective(request); }, expectedError); assert((client.innerApiCalls.deleteServiceLevelObjective as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -929,7 +929,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listServices = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listServices(request); }, expectedError); + await assert.rejects(async () => { await client.listServices(request); }, expectedError); assert((client.innerApiCalls.listServices as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -997,7 +997,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listServices.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listServices, request)); assert.strictEqual( @@ -1048,7 +1048,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listServicesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IService[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1151,7 +1151,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listServiceLevelObjectives = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listServiceLevelObjectives(request); }, expectedError); + await assert.rejects(async () => { await client.listServiceLevelObjectives(request); }, expectedError); assert((client.innerApiCalls.listServiceLevelObjectives as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1219,7 +1219,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listServiceLevelObjectives.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listServiceLevelObjectives, request)); assert.strictEqual( @@ -1270,7 +1270,7 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listServiceLevelObjectives.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listServiceLevelObjectivesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IServiceLevelObjective[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline b/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline index 50c3648db..417165d94 100644 --- a/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline @@ -243,7 +243,7 @@ describe('v3.UptimeCheckServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getUptimeCheckConfig = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getUptimeCheckConfig(request); }, expectedError); + await assert.rejects(async () => { await client.getUptimeCheckConfig(request); }, expectedError); assert((client.innerApiCalls.getUptimeCheckConfig as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -327,7 +327,7 @@ describe('v3.UptimeCheckServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createUptimeCheckConfig = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createUptimeCheckConfig(request); }, expectedError); + await assert.rejects(async () => { await client.createUptimeCheckConfig(request); }, expectedError); assert((client.innerApiCalls.createUptimeCheckConfig as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -414,7 +414,7 @@ describe('v3.UptimeCheckServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateUptimeCheckConfig = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateUptimeCheckConfig(request); }, expectedError); + await assert.rejects(async () => { await client.updateUptimeCheckConfig(request); }, expectedError); assert((client.innerApiCalls.updateUptimeCheckConfig as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -498,7 +498,7 @@ describe('v3.UptimeCheckServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteUptimeCheckConfig = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteUptimeCheckConfig(request); }, expectedError); + await assert.rejects(async () => { await client.deleteUptimeCheckConfig(request); }, expectedError); assert((client.innerApiCalls.deleteUptimeCheckConfig as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -590,7 +590,7 @@ describe('v3.UptimeCheckServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listUptimeCheckConfigs = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listUptimeCheckConfigs(request); }, expectedError); + await assert.rejects(async () => { await client.listUptimeCheckConfigs(request); }, expectedError); assert((client.innerApiCalls.listUptimeCheckConfigs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -658,7 +658,7 @@ describe('v3.UptimeCheckServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listUptimeCheckConfigs.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listUptimeCheckConfigs, request)); assert.strictEqual( @@ -709,7 +709,7 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listUptimeCheckConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listUptimeCheckConfigsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IUptimeCheckConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -788,7 +788,7 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listUptimeCheckIps = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listUptimeCheckIps(request); }, expectedError); + await assert.rejects(async () => { await client.listUptimeCheckIps(request); }, expectedError); assert((client.innerApiCalls.listUptimeCheckIps as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -847,7 +847,7 @@ describe('v3.UptimeCheckServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listUptimeCheckIps.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listUptimeCheckIps, request)); }); @@ -884,7 +884,7 @@ describe('v3.UptimeCheckServiceClient', () => { const request = generateSampleMessage(new protos.google.monitoring.v3.ListUptimeCheckIpsRequest());const expectedError = new Error('expected'); client.descriptors.page.listUptimeCheckIps.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listUptimeCheckIpsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IUptimeCheckIp[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/redis/test/gapic_cloud_redis_v1beta1.ts.baseline b/baselines/redis/test/gapic_cloud_redis_v1beta1.ts.baseline index 5cabdc6aa..946989b12 100644 --- a/baselines/redis/test/gapic_cloud_redis_v1beta1.ts.baseline +++ b/baselines/redis/test/gapic_cloud_redis_v1beta1.ts.baseline @@ -259,7 +259,7 @@ describe('v1beta1.CloudRedisClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getInstance(request); }, expectedError); + await assert.rejects(async () => { await client.getInstance(request); }, expectedError); assert((client.innerApiCalls.getInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -347,7 +347,7 @@ describe('v1beta1.CloudRedisClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.createInstance(request); }, expectedError); + await assert.rejects(async () => { await client.createInstance(request); }, expectedError); assert((client.innerApiCalls.createInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -371,7 +371,7 @@ describe('v1beta1.CloudRedisClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.createInstance(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.createInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -462,7 +462,7 @@ describe('v1beta1.CloudRedisClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.updateInstance(request); }, expectedError); + await assert.rejects(async () => { await client.updateInstance(request); }, expectedError); assert((client.innerApiCalls.updateInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -487,7 +487,7 @@ describe('v1beta1.CloudRedisClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.updateInstance(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.updateInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -575,7 +575,7 @@ describe('v1beta1.CloudRedisClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.importInstance = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.importInstance(request); }, expectedError); + await assert.rejects(async () => { await client.importInstance(request); }, expectedError); assert((client.innerApiCalls.importInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -599,7 +599,7 @@ describe('v1beta1.CloudRedisClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.importInstance = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.importInstance(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.importInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -687,7 +687,7 @@ describe('v1beta1.CloudRedisClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.exportInstance = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.exportInstance(request); }, expectedError); + await assert.rejects(async () => { await client.exportInstance(request); }, expectedError); assert((client.innerApiCalls.exportInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -711,7 +711,7 @@ describe('v1beta1.CloudRedisClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.exportInstance = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.exportInstance(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.exportInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -799,7 +799,7 @@ describe('v1beta1.CloudRedisClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.failoverInstance(request); }, expectedError); + await assert.rejects(async () => { await client.failoverInstance(request); }, expectedError); assert((client.innerApiCalls.failoverInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -823,7 +823,7 @@ describe('v1beta1.CloudRedisClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.failoverInstance(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.failoverInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -911,7 +911,7 @@ describe('v1beta1.CloudRedisClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteInstance(request); }, expectedError); + await assert.rejects(async () => { await client.deleteInstance(request); }, expectedError); assert((client.innerApiCalls.deleteInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -935,7 +935,7 @@ describe('v1beta1.CloudRedisClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.deleteInstance(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.deleteInstance as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1027,7 +1027,7 @@ describe('v1beta1.CloudRedisClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listInstances(request); }, expectedError); + await assert.rejects(async () => { await client.listInstances(request); }, expectedError); assert((client.innerApiCalls.listInstances as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1095,7 +1095,7 @@ describe('v1beta1.CloudRedisClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); assert.strictEqual( @@ -1146,7 +1146,7 @@ describe('v1beta1.CloudRedisClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listInstancesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.redis.v1beta1.IInstance[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/showcase/test/gapic_echo_v1beta1.ts.baseline b/baselines/showcase/test/gapic_echo_v1beta1.ts.baseline index cff616f0c..3e8b2879a 100644 --- a/baselines/showcase/test/gapic_echo_v1beta1.ts.baseline +++ b/baselines/showcase/test/gapic_echo_v1beta1.ts.baseline @@ -268,7 +268,7 @@ describe('v1beta1.EchoClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.echo = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.echo(request); }, expectedError); + await assert.rejects(async () => { await client.echo(request); }, expectedError); assert((client.innerApiCalls.echo as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -328,7 +328,7 @@ describe('v1beta1.EchoClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.block = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.block(request); }, expectedError); + await assert.rejects(async () => { await client.block(request); }, expectedError); assert((client.innerApiCalls.block as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -392,7 +392,7 @@ describe('v1beta1.EchoClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.wait = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.wait(request); }, expectedError); + await assert.rejects(async () => { await client.wait(request); }, expectedError); assert((client.innerApiCalls.wait as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -408,7 +408,7 @@ describe('v1beta1.EchoClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.wait = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.wait(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.wait as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -459,7 +459,7 @@ describe('v1beta1.EchoClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.expand as SinonStub) .getCall(0).calledWith(request, expectedOptions)); }); @@ -513,7 +513,7 @@ describe('v1beta1.EchoClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.chat as SinonStub) .getCall(0).calledWithExactly(undefined)); assert.deepStrictEqual(((stream as unknown as PassThrough) @@ -573,7 +573,7 @@ describe('v1beta1.EchoClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.collect as SinonStub) .getCall(0).calledWith(null, {} /*, callback defined above */)); }); @@ -641,7 +641,7 @@ describe('v1beta1.EchoClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.pagedExpand = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.pagedExpand(request); }, expectedError); + await assert.rejects(async () => { await client.pagedExpand(request); }, expectedError); assert((client.innerApiCalls.pagedExpand as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -700,7 +700,7 @@ describe('v1beta1.EchoClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.pagedExpand.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.pagedExpand, request)); }); @@ -737,7 +737,7 @@ describe('v1beta1.EchoClient', () => { const request = generateSampleMessage(new protos.google.showcase.v1beta1.PagedExpandRequest());const expectedError = new Error('expected'); client.descriptors.page.pagedExpand.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.pagedExpandAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.IEchoResponse[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/showcase/test/gapic_identity_v1beta1.ts.baseline b/baselines/showcase/test/gapic_identity_v1beta1.ts.baseline index 5c6eb6ace..2318f351a 100644 --- a/baselines/showcase/test/gapic_identity_v1beta1.ts.baseline +++ b/baselines/showcase/test/gapic_identity_v1beta1.ts.baseline @@ -219,7 +219,7 @@ describe('v1beta1.IdentityClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createUser(request); }, expectedError); + await assert.rejects(async () => { await client.createUser(request); }, expectedError); assert((client.innerApiCalls.createUser as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -303,7 +303,7 @@ describe('v1beta1.IdentityClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getUser(request); }, expectedError); + await assert.rejects(async () => { await client.getUser(request); }, expectedError); assert((client.innerApiCalls.getUser as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -390,7 +390,7 @@ describe('v1beta1.IdentityClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateUser(request); }, expectedError); + await assert.rejects(async () => { await client.updateUser(request); }, expectedError); assert((client.innerApiCalls.updateUser as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -474,7 +474,7 @@ describe('v1beta1.IdentityClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteUser(request); }, expectedError); + await assert.rejects(async () => { await client.deleteUser(request); }, expectedError); assert((client.innerApiCalls.deleteUser as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -542,7 +542,7 @@ describe('v1beta1.IdentityClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listUsers(request); }, expectedError); + await assert.rejects(async () => { await client.listUsers(request); }, expectedError); assert((client.innerApiCalls.listUsers as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -601,7 +601,7 @@ describe('v1beta1.IdentityClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); }); @@ -638,7 +638,7 @@ describe('v1beta1.IdentityClient', () => { const request = generateSampleMessage(new protos.google.showcase.v1beta1.ListUsersRequest());const expectedError = new Error('expected'); client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listUsersAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.IUser[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline b/baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline index 184156ed4..6511f45aa 100644 --- a/baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline +++ b/baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline @@ -268,7 +268,7 @@ describe('v1beta1.MessagingClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.createRoom = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createRoom(request); }, expectedError); + await assert.rejects(async () => { await client.createRoom(request); }, expectedError); assert((client.innerApiCalls.createRoom as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -352,7 +352,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getRoom = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getRoom(request); }, expectedError); + await assert.rejects(async () => { await client.getRoom(request); }, expectedError); assert((client.innerApiCalls.getRoom as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -439,7 +439,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateRoom = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateRoom(request); }, expectedError); + await assert.rejects(async () => { await client.updateRoom(request); }, expectedError); assert((client.innerApiCalls.updateRoom as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -523,7 +523,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteRoom = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteRoom(request); }, expectedError); + await assert.rejects(async () => { await client.deleteRoom(request); }, expectedError); assert((client.innerApiCalls.deleteRoom as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -607,7 +607,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createBlurb = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createBlurb(request); }, expectedError); + await assert.rejects(async () => { await client.createBlurb(request); }, expectedError); assert((client.innerApiCalls.createBlurb as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -691,7 +691,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getBlurb = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getBlurb(request); }, expectedError); + await assert.rejects(async () => { await client.getBlurb(request); }, expectedError); assert((client.innerApiCalls.getBlurb as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -778,7 +778,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateBlurb = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.updateBlurb(request); }, expectedError); + await assert.rejects(async () => { await client.updateBlurb(request); }, expectedError); assert((client.innerApiCalls.updateBlurb as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -862,7 +862,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteBlurb = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteBlurb(request); }, expectedError); + await assert.rejects(async () => { await client.deleteBlurb(request); }, expectedError); assert((client.innerApiCalls.deleteBlurb as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -950,7 +950,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.searchBlurbs = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.searchBlurbs(request); }, expectedError); + await assert.rejects(async () => { await client.searchBlurbs(request); }, expectedError); assert((client.innerApiCalls.searchBlurbs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -974,7 +974,7 @@ describe('v1beta1.MessagingClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.searchBlurbs = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.searchBlurbs(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.searchBlurbs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1041,7 +1041,7 @@ describe('v1beta1.MessagingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.streamBlurbs as SinonStub) .getCall(0).calledWith(request, expectedOptions)); }); @@ -1095,7 +1095,7 @@ describe('v1beta1.MessagingClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.connect as SinonStub) .getCall(0).calledWithExactly(undefined)); assert.deepStrictEqual(((stream as unknown as PassThrough) @@ -1155,7 +1155,7 @@ describe('v1beta1.MessagingClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.sendBlurbs as SinonStub) .getCall(0).calledWith(null, {} /*, callback defined above */)); }); @@ -1223,7 +1223,7 @@ describe('v1beta1.MessagingClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listRooms = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listRooms(request); }, expectedError); + await assert.rejects(async () => { await client.listRooms(request); }, expectedError); assert((client.innerApiCalls.listRooms as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1282,7 +1282,7 @@ describe('v1beta1.MessagingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listRooms.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listRooms, request)); }); @@ -1319,7 +1319,7 @@ describe('v1beta1.MessagingClient', () => { const request = generateSampleMessage(new protos.google.showcase.v1beta1.ListRoomsRequest());const expectedError = new Error('expected'); client.descriptors.page.listRooms.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listRoomsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.IRoom[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1417,7 +1417,7 @@ describe('v1beta1.MessagingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listBlurbs = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listBlurbs(request); }, expectedError); + await assert.rejects(async () => { await client.listBlurbs(request); }, expectedError); assert((client.innerApiCalls.listBlurbs as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1485,7 +1485,7 @@ describe('v1beta1.MessagingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listBlurbs.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listBlurbs, request)); assert.strictEqual( @@ -1536,7 +1536,7 @@ describe('v1beta1.MessagingClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listBlurbs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listBlurbsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.IBlurb[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/showcase/test/gapic_testing_v1beta1.ts.baseline b/baselines/showcase/test/gapic_testing_v1beta1.ts.baseline index 8c434c389..e3447cbff 100644 --- a/baselines/showcase/test/gapic_testing_v1beta1.ts.baseline +++ b/baselines/showcase/test/gapic_testing_v1beta1.ts.baseline @@ -219,7 +219,7 @@ describe('v1beta1.TestingClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.createSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.createSession(request); }, expectedError); + await assert.rejects(async () => { await client.createSession(request); }, expectedError); assert((client.innerApiCalls.createSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -303,7 +303,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getSession(request); }, expectedError); + await assert.rejects(async () => { await client.getSession(request); }, expectedError); assert((client.innerApiCalls.getSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -387,7 +387,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteSession(request); }, expectedError); + await assert.rejects(async () => { await client.deleteSession(request); }, expectedError); assert((client.innerApiCalls.deleteSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -471,7 +471,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.reportSession = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.reportSession(request); }, expectedError); + await assert.rejects(async () => { await client.reportSession(request); }, expectedError); assert((client.innerApiCalls.reportSession as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -555,7 +555,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteTest = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteTest(request); }, expectedError); + await assert.rejects(async () => { await client.deleteTest(request); }, expectedError); assert((client.innerApiCalls.deleteTest as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -639,7 +639,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.verifyTest = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.verifyTest(request); }, expectedError); + await assert.rejects(async () => { await client.verifyTest(request); }, expectedError); assert((client.innerApiCalls.verifyTest as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -707,7 +707,7 @@ describe('v1beta1.TestingClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listSessions = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listSessions(request); }, expectedError); + await assert.rejects(async () => { await client.listSessions(request); }, expectedError); assert((client.innerApiCalls.listSessions as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -766,7 +766,7 @@ describe('v1beta1.TestingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listSessions.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); }); @@ -803,7 +803,7 @@ describe('v1beta1.TestingClient', () => { const request = generateSampleMessage(new protos.google.showcase.v1beta1.ListSessionsRequest());const expectedError = new Error('expected'); client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listSessionsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.ISession[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -901,7 +901,7 @@ describe('v1beta1.TestingClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listTests = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listTests(request); }, expectedError); + await assert.rejects(async () => { await client.listTests(request); }, expectedError); assert((client.innerApiCalls.listTests as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -969,7 +969,7 @@ describe('v1beta1.TestingClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listTests.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listTests, request)); assert.strictEqual( @@ -1020,7 +1020,7 @@ describe('v1beta1.TestingClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listTests.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listTestsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.showcase.v1beta1.ITest[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/baselines/texttospeech/test/gapic_text_to_speech_v1.ts.baseline b/baselines/texttospeech/test/gapic_text_to_speech_v1.ts.baseline index 3a10d57c6..be20d4f9c 100644 --- a/baselines/texttospeech/test/gapic_text_to_speech_v1.ts.baseline +++ b/baselines/texttospeech/test/gapic_text_to_speech_v1.ts.baseline @@ -172,7 +172,7 @@ describe('v1.TextToSpeechClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.listVoices = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listVoices(request); }, expectedError); + await assert.rejects(async () => { await client.listVoices(request); }, expectedError); assert((client.innerApiCalls.listVoices as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -232,7 +232,7 @@ describe('v1.TextToSpeechClient', () => { const expectedOptions = {}; const expectedError = new Error('expected'); client.innerApiCalls.synthesizeSpeech = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.synthesizeSpeech(request); }, expectedError); + await assert.rejects(async () => { await client.synthesizeSpeech(request); }, expectedError); assert((client.innerApiCalls.synthesizeSpeech as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); diff --git a/baselines/translate/test/gapic_translation_service_v3beta1.ts.baseline b/baselines/translate/test/gapic_translation_service_v3beta1.ts.baseline index 9a151b3f9..e9b431226 100644 --- a/baselines/translate/test/gapic_translation_service_v3beta1.ts.baseline +++ b/baselines/translate/test/gapic_translation_service_v3beta1.ts.baseline @@ -259,7 +259,7 @@ describe('v3beta1.TranslationServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.translateText = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.translateText(request); }, expectedError); + await assert.rejects(async () => { await client.translateText(request); }, expectedError); assert((client.innerApiCalls.translateText as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -343,7 +343,7 @@ describe('v3beta1.TranslationServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.detectLanguage = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.detectLanguage(request); }, expectedError); + await assert.rejects(async () => { await client.detectLanguage(request); }, expectedError); assert((client.innerApiCalls.detectLanguage as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -427,7 +427,7 @@ describe('v3beta1.TranslationServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSupportedLanguages = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getSupportedLanguages(request); }, expectedError); + await assert.rejects(async () => { await client.getSupportedLanguages(request); }, expectedError); assert((client.innerApiCalls.getSupportedLanguages as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -511,7 +511,7 @@ describe('v3beta1.TranslationServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getGlossary = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.getGlossary(request); }, expectedError); + await assert.rejects(async () => { await client.getGlossary(request); }, expectedError); assert((client.innerApiCalls.getGlossary as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -599,7 +599,7 @@ describe('v3beta1.TranslationServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.batchTranslateText(request); }, expectedError); + await assert.rejects(async () => { await client.batchTranslateText(request); }, expectedError); assert((client.innerApiCalls.batchTranslateText as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -623,7 +623,7 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.batchTranslateText(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.batchTranslateText as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -711,7 +711,7 @@ describe('v3beta1.TranslationServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.createGlossary(request); }, expectedError); + await assert.rejects(async () => { await client.createGlossary(request); }, expectedError); assert((client.innerApiCalls.createGlossary as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -735,7 +735,7 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.createGlossary(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.createGlossary as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -823,7 +823,7 @@ describe('v3beta1.TranslationServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.deleteGlossary(request); }, expectedError); + await assert.rejects(async () => { await client.deleteGlossary(request); }, expectedError); assert((client.innerApiCalls.deleteGlossary as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -847,7 +847,7 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.deleteGlossary(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.deleteGlossary as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -939,7 +939,7 @@ describe('v3beta1.TranslationServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listGlossaries = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.listGlossaries(request); }, expectedError); + await assert.rejects(async () => { await client.listGlossaries(request); }, expectedError); assert((client.innerApiCalls.listGlossaries as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -1007,7 +1007,7 @@ describe('v3beta1.TranslationServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.listGlossaries.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); assert.strictEqual( @@ -1058,7 +1058,7 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.listGlossariesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/templates/typescript_gapic/test/gapic_$service_$version.ts.njk b/templates/typescript_gapic/test/gapic_$service_$version.ts.njk index 7a8cd4269..bed29d789 100644 --- a/templates/typescript_gapic/test/gapic_$service_$version.ts.njk +++ b/templates/typescript_gapic/test/gapic_$service_$version.ts.njk @@ -288,7 +288,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { {{ util.initRequestOptions(method) }} const expectedError = new Error('expected'); client.innerApiCalls.{{ method.name.toCamelCase() }} = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.{{ method.name.toCamelCase() }}(request); }, expectedError); + await assert.rejects(async () => { await client.{{ method.name.toCamelCase() }}(request); }, expectedError); assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -354,7 +354,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { {{ util.initRequestOptions(method) }} const expectedError = new Error('expected'); client.innerApiCalls.{{ method.name.toCamelCase() }} = stubLongRunningCall(undefined, expectedError); - assert.rejects(async () => { await client.{{ method.name.toCamelCase() }}(request); }, expectedError); + await assert.rejects(async () => { await client.{{ method.name.toCamelCase() }}(request); }, expectedError); assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -370,7 +370,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { const expectedError = new Error('expected'); client.innerApiCalls.{{ method.name.toCamelCase() }} = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.{{ method.name.toCamelCase() }}(request); - assert.rejects(async () => { await operation.promise(); }, expectedError); + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -423,7 +423,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub) .getCall(0).calledWith(request, expectedOptions)); }); @@ -480,7 +480,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub) .getCall(0).calledWithExactly(undefined)); assert.deepStrictEqual(((stream as unknown as PassThrough) @@ -542,7 +542,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub) .getCall(0).calledWith(null, {} /*, callback defined above */)); }); @@ -604,7 +604,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { {{ util.initRequestOptions(method) }} const expectedError = new Error('expected'); client.innerApiCalls.{{ method.name.toCamelCase() }} = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { await client.{{ method.name.toCamelCase() }}(request); }, expectedError); + await assert.rejects(async () => { await client.{{ method.name.toCamelCase() }}(request); }, expectedError); assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub) .getCall(0).calledWith(request, expectedOptions, undefined)); }); @@ -666,7 +666,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { reject(err); }); }); - assert.rejects(async () => { await promise; }, expectedError); + await assert.rejects(async () => { await promise; }, expectedError); assert((client.descriptors.page.{{ method.name.toCamelCase() }}.createStream as SinonStub) .getCall(0).calledWith(client.innerApiCalls.{{ method.name.toCamelCase() }}, request)); {%- if method.headerRequestParams.length > 0 %} @@ -715,7 +715,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { const expectedError = new Error('expected'); client.descriptors.page.{{ method.name.toCamelCase() }}.asyncIterate = stubAsyncIterationCall(undefined, expectedError); const iterable = client.{{ method.name.toCamelCase() }}Async(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: {{ util.toInterface(method.pagingResponseType) }}[] = []; for await (const resource of iterable) { responses.push(resource!);