-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDependency.test.js
63 lines (55 loc) · 1.71 KB
/
Dependency.test.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const Test = require('thunk-test')
const DynamoTable = require('./DynamoTable')
const DynamoStream = require('./DynamoStream')
const ElasticsearchIndex = require('./ElasticsearchIndex')
const S3Bucket = require('./S3Bucket')
const KinesisStream = require('./KinesisStream')
const Dependency = require('./Dependency')
const test = new Test('Dependency.teardown', async function () {
const myDynamoTable = new DynamoTable({
name: 'my_dynamo_table',
key: [{ a: 'string' }],
endpoint: 'http://localhost:8000',
region: 'dynamodblocal',
})
await myDynamoTable.ready
const myDynamoStream = new DynamoStream({
table: 'my_dynamo_table',
endpoint: 'http://localhost:8000',
region: 'dynamodblocal',
})
await myDynamoStream.ready
const myElasticsearchIndex = new ElasticsearchIndex({
node: 'http://localhost:9200/',
index: 'local_post',
mappings: {
a: { type: 'keyword' },
b: { type: 'keyword' },
},
})
await myElasticsearchIndex.ready
const myS3Bucket = new S3Bucket({
name: 'my-s3-bucket',
endpoint: 'http://localhost:9000',
region: 'us-west-1',
accessKeyId: 'minioadmin',
secretAccessKey: 'minioadmin',
})
await myS3Bucket.ready
const myKinesisStream = new KinesisStream({
name: 'my_kinesis_stream',
endpoint: 'http://localhost:4567',
shardIteratorType: 'TRIM_HORIZON',
})
await myKinesisStream.ready
await Dependency.teardown(null)
await Dependency.teardown(myDynamoTable)
await Dependency.teardown(myDynamoStream)
await Dependency.teardown(myElasticsearchIndex)
await Dependency.teardown(myS3Bucket)
await Dependency.teardown(myKinesisStream)
}).case()
if (process.argv[1] == __filename) {
test()
}
module.exports = test