Skip to content

Commit 189e23d

Browse files
committed
chore: change var to let/const
1 parent fb69de1 commit 189e23d

File tree

69 files changed

+292
-282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+292
-282
lines changed

features/acm/step_definitions/acm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { ACM } = require("../../../clients/client-acm");
1+
const { ACM } = require("../../../clients/client-acm");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@acm" }, function(scenario, callback) {

features/apigateway/step_definitions/apigateway.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { APIGateway } = require("../../../clients/client-api-gateway");
1+
const { APIGateway } = require("../../../clients/client-api-gateway");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@apigateway" }, function(scenario, callback) {

features/autoscaling/step_definitions/autoscaling.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { AutoScaling } = require("../../../clients/client-auto-scaling");
1+
const { AutoScaling } = require("../../../clients/client-auto-scaling");
22
const { Before, Given, Then } = require("cucumber");
33

44
Before({ tags: "@autoscaling" }, function(scenario, callback) {
@@ -10,7 +10,7 @@ Given(/^I create a launch configuration with name "([^"]*)"$/, function(
1010
name,
1111
callback
1212
) {
13-
var params = {
13+
const params = {
1414
ImageId: "ami-1624987f",
1515
InstanceType: "m1.small",
1616
LaunchConfigurationName: name
@@ -33,6 +33,6 @@ Then(/^the list should contain the launch configuration "([^"]*)"$/, function(
3333
});
3434

3535
Then(/^I delete the launch configuration "([^"]*)"$/, function(name, callback) {
36-
var params = { LaunchConfigurationName: name };
36+
const params = { LaunchConfigurationName: name };
3737
this.request(null, "deleteLaunchConfiguration", params, callback);
3838
});

features/cloudformation/step_definitions/cloudformation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CloudFormation } = require("../../../clients/client-cloudformation");
1+
const { CloudFormation } = require("../../../clients/client-cloudformation");
22
const { Before, Given } = require("cucumber");
33

44
Before({ tags: "@cloudformation" }, function(scenario, callback) {
@@ -12,7 +12,7 @@ Given(/^I create a CloudFormation stack with name prefix "([^"]*)"$/, function(
1212
) {
1313
this.stackName = this.uniqueName(prefix);
1414
this.templateBody = '{"Resources":{"member":{"Type":"AWS::SQS::Queue"}}}';
15-
var params = {
15+
const params = {
1616
TemplateBody: this.templateBody,
1717
StackName: this.stackName
1818
};

features/cloudfront/step_definitions/cloudfront.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
var { CloudFront } = require("../../../clients/client-cloudfront");
1+
const { CloudFront } = require("../../../clients/client-cloudfront");
22
const { Before, Given, Then, When } = require("cucumber");
33

4-
var createParams = {
4+
const createParams = {
55
CallerReference: "",
66
Aliases: {
77
Quantity: 0

features/cloudsearch/step_definitions/cloudsearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CloudSearch } = require("../../../clients/client-cloudsearch");
1+
const { CloudSearch } = require("../../../clients/client-cloudsearch");
22
const { Before, Given } = require("cucumber");
33

44
Before({ tags: "@cloudsearch" }, function(scenario, callback) {

features/cloudtrail/step_definitions/cloudtrail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CloudTrail } = require("../../../clients/client-cloudtrail");
1+
const { CloudTrail } = require("../../../clients/client-cloudtrail");
22
const { Before, Given } = require("cucumber");
33

44
Before({ tags: "@cloudtrail" }, function(scenario, callback) {

features/cloudwatch/step_definitions/cloudwatch.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CloudWatch } = require("../../../clients/client-cloudwatch");
1+
const { CloudWatch } = require("../../../clients/client-cloudwatch");
22
const { Before, Given, Then } = require("cucumber");
33

44
Before({ tags: "@cloudwatch" }, function(scenario, callback) {
@@ -11,7 +11,7 @@ Given(/^I create a CloudWatch alarm with (prefix|name) "([^"]*)"$/, function(
1111
name,
1212
callback
1313
) {
14-
var timestamp = new Date().getTime();
14+
const timestamp = new Date().getTime();
1515
this.cloudWatchAlarm = {
1616
AlarmName: name,
1717
MetricName: "aws-sdk-js-metric-" + timestamp,
@@ -37,15 +37,15 @@ Given(/^I create a CloudWatch alarm with (prefix|name) "([^"]*)"$/, function(
3737
});
3838

3939
Given(/^I list the CloudWatch alarms$/, function(callback) {
40-
var params = {
40+
const params = {
4141
MetricName: this.cloudWatchAlarm.MetricName,
4242
Namespace: this.cloudWatchAlarm.Namespace
4343
};
4444
this.request(null, "describeAlarmsForMetric", params, callback);
4545
});
4646

4747
Then(/^the list should contain the CloudWatch alarm$/, function(callback) {
48-
var name = this.cloudWatchAlarm.AlarmName;
48+
const name = this.cloudWatchAlarm.AlarmName;
4949
this.assert.contains(this.data.MetricAlarms, function(alarm) {
5050
return alarm.AlarmName === name;
5151
});

features/cloudwatchevents/step_definitions/cloudwatchevents.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
var { CloudWatchEvents } = require("../../../clients/client-cloudwatch-events");
1+
const {
2+
CloudWatchEvents
3+
} = require("../../../clients/client-cloudwatch-events");
24
const { Before } = require("cucumber");
35

46
Before({ tags: "@cloudwatchevents" }, function(scenario, callback) {

features/cloudwatchlogs/step_definitions/cloudwatchlogs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CloudWatchLogs } = require("../../../clients/client-cloudwatch-logs");
1+
const { CloudWatchLogs } = require("../../../clients/client-cloudwatch-logs");
22
const { Before, Given, Then } = require("cucumber");
33

44
Before({ tags: "@cloudwatchlogs" }, function(scenario, callback) {
@@ -10,7 +10,7 @@ Given(/^I create a CloudWatch logGroup with prefix "([^"]*)"$/, function(
1010
prefix,
1111
callback
1212
) {
13-
var expectErr = prefix === "" ? false : undefined;
13+
const expectErr = prefix === "" ? false : undefined;
1414
this.logGroupName = this.uniqueName(prefix);
1515
this.request(
1616
null,
@@ -26,7 +26,7 @@ Given(/^I list the CloudWatch logGroups$/, function(callback) {
2626
});
2727

2828
Then(/^the list should contain the CloudWatch logGroup$/, function(callback) {
29-
var name = this.logGroupName;
29+
const name = this.logGroupName;
3030
this.assert.contains(this.data.logGroups, function(alarm) {
3131
return alarm.logGroupName === name;
3232
});

features/codecommit/step_definitions/codecommit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CodeCommit } = require("../../../clients/client-codecommit");
1+
const { CodeCommit } = require("../../../clients/client-codecommit");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@codecommit" }, function(scenario, callback) {

features/codedeploy/step_definitions/codedeploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CodeDeploy } = require("../../../clients/client-codedeploy");
1+
const { CodeDeploy } = require("../../../clients/client-codedeploy");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@codedeploy" }, function(scenario, callback) {

features/codepipeline/step_definitions/codepipeline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CodePipeline } = require("../../../clients/client-codepipeline");
1+
const { CodePipeline } = require("../../../clients/client-codepipeline");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@codepipeline" }, function(scenario, callback) {

features/cognitoidentity/step_definitions/cognitoidentity.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CognitoIdentity } = require("../../../clients/client-cognito-identity");
1+
const { CognitoIdentity } = require("../../../clients/client-cognito-identity");
22
const { Before, Given, Then } = require("cucumber");
33

44
Before({ tags: "@cognitoidentity" }, function(scenario, callback) {
@@ -10,8 +10,8 @@ Given(/^I create a Cognito identity pool with prefix "([^"]*)"$/, function(
1010
prefix,
1111
callback
1212
) {
13-
var expectError = prefix === "" ? false : undefined;
14-
var params = {
13+
const expectError = prefix === "" ? false : undefined;
14+
const params = {
1515
IdentityPoolName: this.uniqueName(prefix, ""),
1616
AllowUnauthenticatedIdentities: true
1717
};

features/cognitosync/step_definitions/cognitosync.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { CognitoSync } = require("../../../clients/client-cognito-sync");
1+
const { CognitoSync } = require("../../../clients/client-cognito-sync");
22
const { Before, Given } = require("cucumber");
33

44
Before({ tags: "@cognitosync" }, function(scenario, callback) {
@@ -13,7 +13,7 @@ Given(/^I list Cognito identity pool usage$/, function(callback) {
1313
Given(
1414
/^I list Cognito data sets with identity pool id "([^"]*)" and identity id "([^"]*)"$/,
1515
function(idpid, idid, callback) {
16-
var params = { IdentityPoolId: idpid, IdentityId: idid };
16+
const params = { IdentityPoolId: idpid, IdentityId: idid };
1717
this.request(null, "listDatasets", params, callback, false);
1818
}
1919
);

features/configservice/step_definitions/configservice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { ConfigService } = require("../../../clients/client-config-service");
1+
const { ConfigService } = require("../../../clients/client-config-service");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@configservice" }, function(scenario, callback) {

features/datapipeline/step_definitions/datapipeline.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { DataPipeline } = require("../../../clients/client-data-pipeline");
1+
const { DataPipeline } = require("../../../clients/client-data-pipeline");
22
const { Before, Given } = require("cucumber");
33

44
Before({ tags: "@datapipeline" }, function(scenario, callback) {
@@ -10,7 +10,7 @@ Given(/^I create a Data Pipeline with name prefix "([^"]*)"$/, function(
1010
prefix,
1111
callback
1212
) {
13-
var params = {
13+
const params = {
1414
name: this.uniqueName(prefix),
1515
uniqueId: this.uniqueName("aws-js-sdk")
1616
};

features/devicefarm/step_definitions/devicefarm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { DeviceFarm } = require("../../../clients/client-device-farm");
1+
const { DeviceFarm } = require("../../../clients/client-device-farm");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@devicefarm" }, function(scenario, callback) {

features/directconnect/step_definitions/directconnect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { DirectConnect } = require("../../../clients/client-direct-connect");
1+
const { DirectConnect } = require("../../../clients/client-direct-connect");
22
const { Before, Given } = require("cucumber");
33

44
Before({ tags: "@directconnect" }, function(scenario, callback) {
@@ -9,7 +9,7 @@ Before({ tags: "@directconnect" }, function(scenario, callback) {
99
Given(
1010
/^I create a Direct Connect connection with an invalid location$/,
1111
function(callback) {
12-
var params = {
12+
const params = {
1313
bandwidth: "1Gbps",
1414
location: "INVALID_LOCATION",
1515
connectionName: this.uniqueName("aws-sdk-js")

features/directoryservice/step_definitions/directoryservice.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
var { DirectoryService } = require("../../../clients/client-directory-service");
1+
const {
2+
DirectoryService
3+
} = require("../../../clients/client-directory-service");
24
const { Before } = require("cucumber");
35

46
Before({ tags: "@directoryservice" }, function(scenario, callback) {

features/dms/step_definitions/dms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var {
1+
const {
22
DatabaseMigrationService
33
} = require("../../../clients/client-database-migration-service");
44
const { Before } = require("cucumber");

features/dynamodb/step_definitions/dynamodb.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var jmespath = require("jmespath");
2-
var { DynamoDB } = require("../../../clients/client-dynamodb");
1+
const jmespath = require("jmespath");
2+
const { DynamoDB } = require("../../../clients/client-dynamodb");
33

44
/**
55
* Waits for the tableExists state by periodically calling the underlying
@@ -70,7 +70,7 @@ Before({ tags: "@dynamodb" }, function(scenario, next) {
7070
});
7171

7272
function createTable(world, callback) {
73-
var params = {
73+
const params = {
7474
TableName: world.tableName,
7575
AttributeDefinitions: [{ AttributeName: "id", AttributeType: "S" }],
7676
KeySchema: [{ AttributeName: "id", KeyType: "HASH" }],
@@ -90,9 +90,9 @@ function createTable(world, callback) {
9090
}
9191

9292
Given(/^I have a table$/, function(callback) {
93-
var world = this;
93+
const world = this;
9494
this.service.listTables({}, function(err, data) {
95-
for (var i = 0; i < data.TableNames.length; i++) {
95+
for (const i = 0; i < data.TableNames.length; i++) {
9696
if (data.TableNames[i] == world.tableName) {
9797
callback();
9898
return;
@@ -103,10 +103,10 @@ Given(/^I have a table$/, function(callback) {
103103
});
104104

105105
When(/^I create a table$/, function(callback) {
106-
var world = this;
106+
const world = this;
107107
this.tableName = this.uniqueName("aws-sdk-js-integration");
108108
this.service.listTables({}, function(err, data) {
109-
for (var i = 0; i < data.TableNames.length; i++) {
109+
for (const i = 0; i < data.TableNames.length; i++) {
110110
if (data.TableNames[i] == world.tableName) {
111111
callback();
112112
return;
@@ -117,12 +117,12 @@ When(/^I create a table$/, function(callback) {
117117
});
118118

119119
When(/^I put the item:$/, function(string, next) {
120-
var params = { TableName: this.tableName, Item: JSON.parse(string) };
120+
const params = { TableName: this.tableName, Item: JSON.parse(string) };
121121
this.request(null, "putItem", params, next);
122122
});
123123

124124
When(/^I put a recursive item$/, function(next) {
125-
var params = {
125+
const params = {
126126
TableName: this.tableName,
127127
Item: {
128128
id: { S: "fooRecursive" },
@@ -147,7 +147,7 @@ When(/^I put a recursive item$/, function(next) {
147147
});
148148

149149
Then(/^the item with id "([^"]*)" should exist$/, function(key, next) {
150-
var params = { TableName: this.tableName, Key: { id: { S: key } } };
150+
const params = { TableName: this.tableName, Key: { id: { S: key } } };
151151
this.request(null, "getItem", params, next);
152152
});
153153

@@ -161,7 +161,7 @@ Then(/^it should have attribute "([^"]*)" containing "([^"]*)"$/, function(
161161
});
162162

163163
When(/^I delete the table$/, function(next) {
164-
var params = { TableName: this.tableName };
164+
const params = { TableName: this.tableName };
165165
this.request(null, "deleteTable", params, next);
166166
});
167167

@@ -177,9 +177,9 @@ Given(/^my first request is corrupted with CRC checking (ON|OFF)$/, function(
177177
toggle,
178178
callback
179179
) {
180-
var world = this;
180+
const world = this;
181181
this.service.config.dynamoDbCrc32 = toggle == "ON" ? true : false;
182-
var req = this.service.listTables();
182+
const req = this.service.listTables();
183183
this.service.config.dynamoDbCrc32 = true;
184184
req.removeAllListeners("httpData");
185185
req.on("httpData", function(chunk, resp) {
@@ -209,8 +209,8 @@ Then(/^the request should( not)? be retried$/, function(retry, callback) {
209209
Given(/^all of my requests are corrupted with CRC checking ON$/, function(
210210
callback
211211
) {
212-
var world = this;
213-
var req = this.service.listTables();
212+
const world = this;
213+
const req = this.service.listTables();
214214
req.removeAllListeners("httpData");
215215
req.on("httpData", function(chunk, resp) {
216216
resp.httpResponse.body = Buffer.from('{"invalid":"response"}');
@@ -244,7 +244,7 @@ Then(/^the request should( not)? fail with a CRC checking error$/, function(
244244
Given(
245245
/^I try to delete an item with key "([^"]*)" from table "([^"]*)"$/,
246246
function(key, table, callback) {
247-
var params = { TableName: table, Key: { id: { S: key } } };
247+
const params = { TableName: table, Key: { id: { S: key } } };
248248
this.request(null, "deleteItem", params, callback, false);
249249
}
250250
);

features/dynamodbstreams/step_definitions/dynamodbstreams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { DynamoDBStreams } = require("../../../clients/client-dynamodb-streams");
1+
const { DynamoDBStreams } = require("../../../clients/client-dynamodb-streams");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@dynamodbstreams" }, function(scenario, callback) {

features/ec2/step_definitions/ec2.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
var { EC2 } = require("../../../clients/client-ec2");
1+
const { EC2 } = require("../../../clients/client-ec2");
2+
const { Before, Given, Then } = require("cucumber");
23

34
/**
45
* Waits for the volumeAvailable state by periodically calling the underlying
@@ -37,7 +38,6 @@ const waitForVolumeAvailable = (ec2, volumeId, callback) => {
3738
};
3839
checkForVolumeAvailable();
3940
};
40-
const { Before, Given, Then, When } = require("cucumber");
4141

4242
Before({ tags: "@ec2" }, function(scenario, callback) {
4343
this.service = new EC2({});
@@ -76,12 +76,12 @@ Given(/^I describe the EC2 instance "([^"]*)"$/, function(
7676
Given(/^I attempt to copy an encrypted snapshot across regions$/, function(
7777
callback
7878
) {
79-
var self = this;
80-
var volId, srcSnapId, dstSnapId, params;
81-
var sourceRegion = "us-west-2";
82-
var destRegion = "us-east-1";
83-
var srcEc2 = new EC2({ region: sourceRegion });
84-
var dstEc2 = new EC2({ region: destRegion });
79+
const self = this;
80+
let volId, srcSnapId, dstSnapId, params;
81+
const sourceRegion = "us-west-2";
82+
const destRegion = "us-east-1";
83+
const srcEc2 = new EC2({ region: sourceRegion });
84+
const dstEc2 = new EC2({ region: destRegion });
8585

8686
function teardown() {
8787
if (volId) srcEc2.deleteVolume({ VolumeId: volId }).send();

features/ecr/step_definitions/ecr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var { ECR } = require("../../../clients/client-ecr");
1+
const { ECR } = require("../../../clients/client-ecr");
22
const { Before } = require("cucumber");
33

44
Before({ tags: "@ecr" }, function(scenario, callback) {

0 commit comments

Comments
 (0)