Skip to content

Commit 79eb2ad

Browse files
committed
fixups post reviews
1 parent 3e2bdfc commit 79eb2ad

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

tests/functional/aws-node-sdk/test/bucket/deleteBucketLifecycle.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ describe('aws-sdk test delete bucket lifecycle', () => {
4747
it('should return NoSuchBucket error if bucket does not exist', async () => {
4848
try {
4949
await s3.send(new DeleteBucketLifecycleCommand({ Bucket: bucket }));
50-
// Should not reach here
5150
throw new Error('Expected NoSuchBucket error');
5251
} catch (err) {
5352
assertError(err, 'NoSuchBucket');
@@ -62,7 +61,6 @@ describe('aws-sdk test delete bucket lifecycle', () => {
6261
it('should return AccessDenied if user is not bucket owner', async () => {
6362
try {
6463
await otherAccountS3.send(new DeleteBucketLifecycleCommand({ Bucket: bucket }));
65-
// Should not reach here
6664
throw new Error('Expected AccessDenied error');
6765
} catch (err) {
6866
assertError(err, 'AccessDenied');

tests/functional/aws-node-sdk/test/bucket/getLocation.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ async function deleteBucket(s3, bucket) {
2020
try {
2121
await s3.send(new DeleteBucketCommand({ Bucket: bucket }));
2222
} catch (err) {
23-
// eslint-disable-next-line no-console
24-
console.log(err);
23+
if (err?.name === 'NoSuchBucket') {
24+
return;
25+
}
26+
throw err;
2527
}
2628
}
2729

tests/functional/aws-node-sdk/test/bucket/skipScan.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@ function cutAttributes(data) {
1515
data.Contents.forEach(item => {
1616
newContent.push(item.Key);
1717
});
18-
/* eslint-disable no-param-reassign */
18+
/* eslint-disable-next-line no-param-reassign */
1919
data.Contents = newContent;
2020
}
2121
if (data.CommonPrefixes) {
2222
data.CommonPrefixes.forEach(item => {
2323
newPrefixes.push(item.Prefix);
2424
});
25-
/* eslint-disable no-param-reassign */
25+
/* eslint-disable-next-line no-param-reassign */
2626
data.CommonPrefixes = newPrefixes;
2727
}
2828
if (data.NextMarker === '') {
29-
/* eslint-disable no-param-reassign */
29+
/* eslint-disable-next-line no-param-reassign */
3030
delete data.NextMarker;
3131
}
3232
if (data.EncodingType === '') {
33-
/* eslint-disable no-param-reassign */
33+
/* eslint-disable-next-line no-param-reassign */
3434
delete data.EncodingType;
3535
}
3636
if (data.Delimiter === '') {
37-
/* eslint-disable no-param-reassign */
37+
/* eslint-disable-next-line no-param-reassign */
3838
delete data.Delimiter;
3939
}
4040
}

0 commit comments

Comments
 (0)