Skip to content

Commit

Permalink
just added indentation for test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakhi Mundhada authored and Rakhi Mundhada committed Nov 3, 2023
1 parent fd1ec7f commit 4ae33bd
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions test/paws_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ function mockDDB(getItemStub, putItemStub, updateItemStub, batchWriteItemStub) {
}

function restoreDDB(){
pawsStub.restore(DynamoDB,'getItem');
pawsStub.restore(DynamoDB,'putItem');
pawsStub.restore(DynamoDB,'updateItem');
pawsStub.restore(DynamoDB,'batchWriteItem');
pawsStub.restore(DynamoDB, 'getItem');
pawsStub.restore(DynamoDB, 'putItem');
pawsStub.restore(DynamoDB, 'updateItem');
pawsStub.restore(DynamoDB, 'batchWriteItem');
}

function mockCloudWatch() {
Expand Down Expand Up @@ -281,13 +281,13 @@ describe('Unit Tests', function() {
beforeEach(function(){
pawsStub.mock(KMS, 'decrypt', function (params, callback) {
const data = {
Plaintext : Buffer.from('decrypted-aims-sercret-key')
};
Plaintext: Buffer.from('decrypted-aims-sercret-key')
};
return callback(null, data);
});
pawsStub.mock(KMS, 'encrypt', function (params, callback) {
const data = {
CiphertextBlob : Buffer.from('creds-from-file').toString('base64')
CiphertextBlob: Buffer.from('creds-from-file').toString('base64')
};
return callback(null, data);
});
Expand Down Expand Up @@ -316,8 +316,8 @@ describe('Unit Tests', function() {
restoreAlServiceStub();
setEnvStub.restore();
responseStub.restore();
pawsStub.restore(KMS,'decrypt');
pawsStub.restore(KMS,'encrypt');
pawsStub.restore(KMS, 'decrypt');
pawsStub.restore(KMS, 'encrypt');
pawsStub.restore(SSM, 'getParameter');
pawsStub.restore(SQS, 'sendMessage');
sqsSendMessageBatchStub.restore();
Expand Down Expand Up @@ -963,7 +963,7 @@ describe('Unit Tests', function() {
assert.equal(err.errorCode, 'AWSC0018');
assert.equal(err.httpErrorCode, 404);
processLog.restore();
pawsStub.restore(CloudWatch,'putMetricData');
pawsStub.restore(CloudWatch, 'putMetricData');
done();
});
});
Expand All @@ -984,7 +984,7 @@ describe('Unit Tests', function() {
var collector = new TestCollector(ctx, creds);
collector.reportApiThrottling(function(error) {
assert.equal(null, error);
pawsStub.restore(CloudWatch,'putMetricData');
pawsStub.restore(CloudWatch, 'putMetricData');
done();
});
});
Expand All @@ -1002,7 +1002,7 @@ describe('Unit Tests', function() {
}
};

pawsStub.restore(KMS,'encrypt');
pawsStub.restore(KMS, 'encrypt');

pawsStub.mock(SSM, 'putParameter', (params, callback) => callback(null, {Version: 2, Tier:'Standard'}));

Expand All @@ -1019,7 +1019,7 @@ describe('Unit Tests', function() {
collector.setPawsSecret(secretValue).then((res) => {
assert.equal(res.Version, 2);
assert.equal(res.Tier, 'Standard');
pawsStub.restore(SSM,'putParameter');
pawsStub.restore(SSM, 'putParameter');
done();
});
});
Expand All @@ -1042,7 +1042,7 @@ describe('Unit Tests', function() {
var collector = new TestCollector(ctx, creds);
collector.reportCollectionDelay('2020-01-26T12:08:31.316Z', function(error) {
assert.equal(null, error);
pawsStub.restore(CloudWatch,'putMetricData');
pawsStub.restore(CloudWatch, 'putMetricData');
done();
});
});
Expand Down Expand Up @@ -1090,7 +1090,7 @@ describe('Unit Tests', function() {
collector.reportErrorToIngestApi(errorObj, function(error) {
assert.equal(errorObj.errorCode, 'E0000011');
assert.equal(null, error);
pawsStub.restore(CloudWatch,'putMetricData');
pawsStub.restore(CloudWatch, 'putMetricData');
done();
});
});
Expand All @@ -1116,7 +1116,7 @@ describe('Unit Tests', function() {
var collector = new TestCollector(ctx, creds);
collector.reportDuplicateLogCount(6, function(error) {
assert.equal(null, error);
pawsStub.restore(CloudWatch,'putMetricData');
pawsStub.restore(CloudWatch, 'putMetricData');
done();
});
});
Expand All @@ -1139,7 +1139,7 @@ describe('Unit Tests', function() {
const status = 'ok';
collector.reportCollectorStatus(status, function(error) {
assert.equal(null, error);
pawsStub.restore(CloudWatch,'putMetricData');
pawsStub.restore(CloudWatch, 'putMetricData');
done();
});
});
Expand Down Expand Up @@ -1473,7 +1473,7 @@ describe('Unit Tests', function() {
collector.removeDuplicatedItem(pawsMock.MOCK_LOGS, 'Id', (error, uniqueLogs) => {
assert.equal(error, null);
assert.equal(uniqueLogs.length, 1);
pawsStub.restore(CloudWatch,'putMetricData');
pawsStub.restore(CloudWatch, 'putMetricData');
done();
});
});
Expand Down

0 comments on commit 4ae33bd

Please sign in to comment.