Skip to content

Commit fa2a2ee

Browse files
authored
test(s3): add neither arn nor name are provided case (#25645)
Add test case for `parseBucketName` at `aws-s3/lib/util.ts` Closes #<issue number here>. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 383cccb commit fa2a2ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/aws-cdk-lib/aws-s3/test/util.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,10 @@ describe('utils', () => {
5757
const bucketArn = 'invalid-arn';
5858
expect(() => parseBucketName(stack, { bucketArn })).toThrow(/ARNs must/);
5959
});
60+
61+
test('undefined if neither arn nor name are provided', () => {
62+
const stack = new cdk.Stack();
63+
expect(parseBucketName(stack, {})).toBeUndefined();
64+
});
6065
});
6166
});

0 commit comments

Comments
 (0)