Skip to content

Commit

Permalink
test(s3): add neither arn nor name are provided case (#25645)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
wafuwafu13 authored May 31, 2023
1 parent 383cccb commit fa2a2ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/aws-cdk-lib/aws-s3/test/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,10 @@ describe('utils', () => {
const bucketArn = 'invalid-arn';
expect(() => parseBucketName(stack, { bucketArn })).toThrow(/ARNs must/);
});

test('undefined if neither arn nor name are provided', () => {
const stack = new cdk.Stack();
expect(parseBucketName(stack, {})).toBeUndefined();
});
});
});

0 comments on commit fa2a2ee

Please sign in to comment.