presidium 1.4.3 → 1.4.4

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.
@@ -1,5 +1,7 @@
1
1
  const Readable = require('../Readable')
2
2
  const AwsError = require('./AwsError')
3
+ const retryableErrorNames = require('./retryableErrorNames')
4
+ const sleep = require('./sleep')
3
5
 
4
6
  /**
5
7
  * @name handleAwsResponse
@@ -0,0 +1,34 @@
1
+ const Test = require('thunk-test')
2
+ const handleAwsResponse = require('./handleAwsResponse')
3
+ const stream = require('stream')
4
+
5
+ const test = new Test('handleAwsResponse', handleAwsResponse)
6
+
7
+ const response1 = stream.Readable.from([JSON.stringify({ A: 1 })])
8
+ response1.ok = true
9
+
10
+ test.case(response1, { A: 1 })
11
+
12
+ const response2 = stream.Readable.from([JSON.stringify({
13
+ __type: 'Forbidden',
14
+ Message: 'A',
15
+ })])
16
+ response2.ok = false
17
+
18
+ test.throws(response2, { name: 'Forbidden', message: 'A' })
19
+
20
+ const response3 = stream.Readable.from([JSON.stringify({
21
+ __type: 'ThrottlingException',
22
+ Message: 'A',
23
+ })])
24
+ response3.ok = false
25
+
26
+ function identity(value) { return value }
27
+
28
+ test.case(response3, identity, 1, 1)
29
+
30
+ if (process.argv[1] == __filename) {
31
+ test()
32
+ }
33
+
34
+ module.exports = test
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",