Skip to content

Commit

Permalink
fix: expectedParams in tests should not print out null string, instea…
Browse files Browse the repository at this point in the history
…d should print empty string (#1621)

see: https://togithub.com/googleapis/google-cloud-node/pull/5451/commits/a41d855dd3dac948ef98cc5d8084a7419825e084 (was failing beforehand)

This matches what we did in ESM.
  • Loading branch information
sofisl authored Aug 12, 2024
1 parent 5dd4ab7 commit 67af202
Show file tree
Hide file tree
Showing 29 changed files with 836 additions and 836 deletions.
44 changes: 22 additions & 22 deletions baselines/asset/test/gapic_asset_service_v1.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse()
);
Expand All @@ -268,7 +268,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse()
);
Expand Down Expand Up @@ -306,7 +306,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedError = new Error('expected');
client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall(undefined, expectedError);
await assert.rejects(client.batchGetAssetsHistory(request), expectedError);
Expand Down Expand Up @@ -349,7 +349,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.CreateFeedRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.Feed()
);
Expand All @@ -376,7 +376,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.CreateFeedRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.Feed()
);
Expand Down Expand Up @@ -414,7 +414,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.CreateFeedRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedError = new Error('expected');
client.innerApiCalls.createFeed = stubSimpleCall(undefined, expectedError);
await assert.rejects(client.createFeed(request), expectedError);
Expand Down Expand Up @@ -457,7 +457,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.GetFeedRequest', ['name']);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.Feed()
);
Expand All @@ -484,7 +484,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.GetFeedRequest', ['name']);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.Feed()
);
Expand Down Expand Up @@ -522,7 +522,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.GetFeedRequest', ['name']);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`;
const expectedError = new Error('expected');
client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError);
await assert.rejects(client.getFeed(request), expectedError);
Expand Down Expand Up @@ -565,7 +565,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.ListFeedsRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.ListFeedsResponse()
);
Expand All @@ -592,7 +592,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.ListFeedsRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.ListFeedsResponse()
);
Expand Down Expand Up @@ -630,7 +630,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.ListFeedsRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedError = new Error('expected');
client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError);
await assert.rejects(client.listFeeds(request), expectedError);
Expand Down Expand Up @@ -674,7 +674,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.UpdateFeedRequest', ['feed', 'name']);
request.feed.name = defaultValue1;
const expectedHeaderRequestParams = `feed.name=${defaultValue1}`;
const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.Feed()
);
Expand Down Expand Up @@ -702,7 +702,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.UpdateFeedRequest', ['feed', 'name']);
request.feed.name = defaultValue1;
const expectedHeaderRequestParams = `feed.name=${defaultValue1}`;
const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.cloud.asset.v1.Feed()
);
Expand Down Expand Up @@ -741,7 +741,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.UpdateFeedRequest', ['feed', 'name']);
request.feed.name = defaultValue1;
const expectedHeaderRequestParams = `feed.name=${defaultValue1}`;
const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? '' }`;
const expectedError = new Error('expected');
client.innerApiCalls.updateFeed = stubSimpleCall(undefined, expectedError);
await assert.rejects(client.updateFeed(request), expectedError);
Expand Down Expand Up @@ -785,7 +785,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.DeleteFeedRequest', ['name']);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.protobuf.Empty()
);
Expand All @@ -812,7 +812,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.DeleteFeedRequest', ['name']);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.protobuf.Empty()
);
Expand Down Expand Up @@ -850,7 +850,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.DeleteFeedRequest', ['name']);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`;
const expectedError = new Error('expected');
client.innerApiCalls.deleteFeed = stubSimpleCall(undefined, expectedError);
await assert.rejects(client.deleteFeed(request), expectedError);
Expand Down Expand Up @@ -893,7 +893,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.ExportAssetsRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.longrunning.Operation()
);
Expand Down Expand Up @@ -921,7 +921,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.ExportAssetsRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedResponse = generateSampleMessage(
new protos.google.longrunning.Operation()
);
Expand Down Expand Up @@ -962,7 +962,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.ExportAssetsRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedError = new Error('expected');
client.innerApiCalls.exportAssets = stubLongRunningCall(undefined, expectedError);
await assert.rejects(client.exportAssets(request), expectedError);
Expand All @@ -986,7 +986,7 @@ describe('v1.AssetServiceClient', () => {
const defaultValue1 =
getTypeDefaultValue('.google.cloud.asset.v1.ExportAssetsRequest', ['parent']);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;
const expectedError = new Error('expected');
client.innerApiCalls.exportAssets = stubLongRunningCall(undefined, undefined, expectedError);
const [operation] = await client.exportAssets(request);
Expand Down
Loading

0 comments on commit 67af202

Please sign in to comment.