Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Oct 18, 2024
1 parent 6aa1dc7 commit c420097
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/aws-cdk-lib/aws-s3/test/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ describe('rules', () => {

describe('required properties for rules', () => {
test('throw if there is a rule doesn\'t have required properties', () => {
const app = new App();
const stack = new Stack(app);
const stack = new Stack();
new Bucket(stack, 'MyBucket', {
lifecycleRules: [
{
Expand All @@ -350,13 +349,12 @@ describe('rules', () => {
],
});
expect(() => {
app.synth();
Template.fromStack(stack);
}).toThrow(/All rules for `lifecycleRules` must have at least one of the following properties: `abortIncompleteMultipartUploadAfter`, `expiration`, `expirationDate`, `expiredObjectDeleteMarker`, `noncurrentVersionExpiration`, `noncurrentVersionsToRetain`, `noncurrentVersionTransitions`, or `transitions`/);
});

test('throw if there are a valid rule and a rule that doesn\'t have required properties.', () => {
const app = new App();
const stack = new Stack(app);
const stack = new Stack();
new Bucket(stack, 'MyBucket', {
lifecycleRules: [
{
Expand All @@ -369,7 +367,7 @@ describe('rules', () => {
],
});
expect(() => {
app.synth();
Template.fromStack(stack);
}).toThrow(/All rules for `lifecycleRules` must have at least one of the following properties: `abortIncompleteMultipartUploadAfter`, `expiration`, `expirationDate`, `expiredObjectDeleteMarker`, `noncurrentVersionExpiration`, `noncurrentVersionsToRetain`, `noncurrentVersionTransitions`, or `transitions`/);
});

Expand Down

0 comments on commit c420097

Please sign in to comment.