-
Notifications
You must be signed in to change notification settings - Fork 544
/
cognitoidentity.js
38 lines (34 loc) · 1.02 KB
/
cognitoidentity.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
const { CognitoIdentity } = require("../../../clients/client-cognito-identity");
const { Before, Given, Then } = require("cucumber");
Before({ tags: "@cognitoidentity" }, function (scenario, callback) {
this.service = new CognitoIdentity({});
callback();
});
Given("I create a Cognito identity pool with prefix {string}", function (
prefix,
callback
) {
const expectError = prefix === "" ? false : undefined;
const params = {
IdentityPoolName: this.uniqueName(prefix, ""),
AllowUnauthenticatedIdentities: true
};
this.request(null, "createIdentityPool", params, callback, expectError);
});
Given("I describe the Cognito identity pool ID", function (callback) {
this.identityPoolId = this.data.IdentityPoolId;
this.request(
null,
"describeIdentityPool",
{ IdentityPoolId: this.data.IdentityPoolId },
callback
);
});
Then("I delete the Cognito identity pool", function (callback) {
this.request(
null,
"deleteIdentityPool",
{ IdentityPoolId: this.identityPoolId },
callback
);
});