Skip to content

Commit

Permalink
Removed promise chain
Browse files Browse the repository at this point in the history
Signed-off-by: Aayush Chouhan <[email protected]>
  • Loading branch information
achouhan09 committed Jan 7, 2025
1 parent 7b854c0 commit 67db761
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/test/lifecycle/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ function id_lifecycle_configuration(Bucket, Key) {
}

function duplicate_id_lifecycle_configuration(Bucket, Key) {
const ID1 = 'rule_id1';
const ID2 = 'rule_id2';
const ID1 = 'rule_id';
const ID2 = 'rule_id';
return {
Bucket,
LifecycleConfiguration: {
Expand Down Expand Up @@ -546,9 +546,10 @@ exports.test_and_prefix_size = async function(Bucket, Key, s3) {
exports.test_rule_duplicate_id = async function(Bucket, Key, s3) {
const putLifecycleParams = duplicate_id_lifecycle_configuration(Bucket, Key);

await s3.putBucketLifecycleConfiguration(putLifecycleParams)
.catch(error => {
assert(error.code === 'InvalidArgument', 'Expected InvalidArgument: duplicate id found in the rules');
console.log('Expected error received, duplicate id found in the rules each rule must have a unique id');
});
try {
await s3.putBucketLifecycleConfiguration(putLifecycleParams);
} catch (error) {
assert(error.code === 'InvalidArgument', 'Expected InvalidArgument: duplicate ID found in the rules');
console.log('Expected error received: each rule must have a unique ID, duplicate ID found');
}
};

0 comments on commit 67db761

Please sign in to comment.