presidium 0.16.20 → 0.16.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "0.16.20",
3
+ "version": "0.16.21",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",
package/teardown.js CHANGED
@@ -17,7 +17,10 @@ const KinesisStream = require('./KinesisStream')
17
17
  * ```
18
18
  */
19
19
  const teardown = async function (dependency) {
20
- if (dependency.constructor == DynamoTable) {
20
+ if (dependency == null) {
21
+ // noop
22
+ }
23
+ else if (dependency.constructor == DynamoTable) {
21
24
  await dependency.delete()
22
25
  }
23
26
  else if (dependency.constructor == DynamoStream) {
package/teardown.test.js CHANGED
@@ -1,9 +1,9 @@
1
1
  const Test = require('thunk-test')
2
- const DynamoTable = require('presidium/DynamoTable')
3
- const DynamoStream = require('presidium/DynamoStream')
4
- const ElasticsearchIndex = require('presidium/ElasticsearchIndex')
5
- const S3Bucket = require('presidium/S3Bucket')
6
- const KinesisStream = require('presidium/KinesisStream')
2
+ const DynamoTable = require('./DynamoTable')
3
+ const DynamoStream = require('./DynamoStream')
4
+ const ElasticsearchIndex = require('./ElasticsearchIndex')
5
+ const S3Bucket = require('./S3Bucket')
6
+ const KinesisStream = require('./KinesisStream')
7
7
  const teardown = require('./teardown')
8
8
 
9
9
  const test = new Test('teardown', async function () {
@@ -48,6 +48,7 @@ const test = new Test('teardown', async function () {
48
48
  })
49
49
  await myKinesisStream.ready
50
50
 
51
+ await teardown(null)
51
52
  await teardown(myDynamoTable)
52
53
  await teardown(myDynamoStream)
53
54
  await teardown(myElasticsearchIndex)