-
Notifications
You must be signed in to change notification settings - Fork 548
/
cloudwatchlogs.js
43 lines (38 loc) · 1.1 KB
/
cloudwatchlogs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const { CloudWatchLogs } = require("../../../clients/client-cloudwatch-logs");
const { Before, Given, Then } = require("cucumber");
Before({ tags: "@cloudwatchlogs" }, function (scenario, callback) {
this.service = new CloudWatchLogs({});
callback();
});
Given("I create a CloudWatch logGroup with prefix {string}", function (
prefix,
callback
) {
const expectErr = prefix === "" ? false : undefined;
this.logGroupName = this.uniqueName(prefix);
this.request(
null,
"createLogGroup",
{ logGroupName: this.logGroupName },
callback,
expectErr
);
});
Given("I list the CloudWatch logGroups", function (callback) {
this.request(null, "describeLogGroups", {}, callback);
});
Then("the list should contain the CloudWatch logGroup", function (callback) {
const name = this.logGroupName;
this.assert.contains(this.data.logGroups, function (alarm) {
return alarm.logGroupName === name;
});
callback();
});
Then("I delete the CloudWatch logGroup", function (callback) {
this.request(
null,
"deleteLogGroup",
{ logGroupName: this.logGroupName },
callback
);
});