-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.spec.js
49 lines (49 loc) · 1.74 KB
/
index.spec.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
44
45
46
47
48
49
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("./index");
/* eslint-disable @typescript-eslint/no-var-requires */
const config = require('../my_config.json');
//console.log('config', config);
describe('iam list-users', () => {
it('should work', () => {
const result = true;
expect(result).toBeTruthy();
const options = new index_1.Options(
/* accessKey */ config.accessKeyId,
/* secretKey */ config.secretAccessKey,
/* sessionToken */ config.sessionToken,
/* currentWorkingDirectory */ undefined,
/* cliPath */ 'aws');
const aws = new index_1.Aws(options);
//const command = 'iam list-users --region us-west-1';
const command = `iam \
list-users \
--region us-west-1`;
return aws.command(command).then((data) => {
//console.log('data = ', util.inspect(data, { depth: 10 }));
expect(data).toBeTruthy();
expect(data.object.Users).toBeTruthy();
});
});
});
// describe('iam list-users', () => {
// it('should fail with invalid sessionToken', () => {
// const result = true;
// expect(result).toBeTruthy();
// const options = new Options(
// /* accessKey */ config.accessKeyId,
// /* secretKey */ config.secretAccessKey,
// /* sessionToken */ 'invalid',
// /* currentWorkingDirectory */ undefined,
// );
// const aws = new Aws(options);
// let flag = false;
// return aws.command('iam list-users').then((data: any) => {
// flag = true;
// }).catch((r) => {
// expect(flag).toBeFalsy();
// //console.log('r = ', r);
// });
// });
// });
//# sourceMappingURL=index.spec.js.map