lambda-test
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -18,4 +18,4 @@ | ||
files: [ | ||
'lib/HandlerTester.js', | ||
'lib/LambdaTest.js' | ||
'lib/LambdaTest.js', | ||
'lib/HandlerTester.js' | ||
] | ||
@@ -22,0 +22,0 @@ }); |
@@ -13,2 +13,7 @@ /* | ||
/** | ||
* | ||
* @constructor | ||
* @param {string} [blueprintFile] - api blueprint | ||
*/ | ||
constructor (blueprintFile = null) { | ||
@@ -15,0 +20,0 @@ this._blueprintFile = blueprintFile; |
{ | ||
"name": "lambda-test", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
101
README.md
@@ -49,87 +49,52 @@ # Lambda test | ||
----------------- | ||
# API | ||
<a name="HandlerTester"></a> | ||
## Classes | ||
## HandlerTester | ||
**Kind**: global class | ||
<dl> | ||
<dt><a href="#LambdaTest">LambdaTest</a></dt> | ||
<dd></dd> | ||
<dt><a href="#HandlerTester">HandlerTester</a></dt> | ||
<dd></dd> | ||
</dl> | ||
* [HandlerTester](#HandlerTester) | ||
* [new HandlerTester(handler, [statusCode], [httpMethod], [route], [api])](#new_HandlerTester_new) | ||
* [.queryStringParameters(query)](#HandlerTester+queryStringParameters) ⇒ <code>this</code> | ||
* [.body(body)](#HandlerTester+body) ⇒ <code>this</code> | ||
* [.headers(headers)](#HandlerTester+headers) ⇒ <code>this</code> | ||
* [.pathParameters(params)](#HandlerTester+pathParameters) ⇒ <code>this</code> | ||
* [.run()](#HandlerTester+run) ⇒ <code>Promise.<Object></code> | ||
* [.verify()](#HandlerTester+verify) ⇒ <code>Promise.<Object></code> | ||
<a name="LambdaTest"></a> | ||
<a name="new_HandlerTester_new"></a> | ||
## LambdaTest | ||
**Kind**: global class | ||
### new HandlerTester(handler, [statusCode], [httpMethod], [route], [api]) | ||
* [LambdaTest](#LambdaTest) | ||
* [new LambdaTest([blueprintFile])](#new_LambdaTest_new) | ||
* [._getBlueprint()](#LambdaTest+_getBlueprint) ⇒ <code>ApiBlueprint</code> | ||
* [.test(handler, [routeOrStatus], [httpMethod], [statusCode])](#LambdaTest+test) ⇒ [<code>HandlerTester</code>](#HandlerTester) | ||
| Param | Type | Default | | ||
| --- | --- | --- | | ||
| handler | <code>function</code> | | | ||
| [statusCode] | <code>number</code> \| <code>null</code> | <code></code> | | ||
| [httpMethod] | <code>string</code> \| <code>null</code> | <code>null</code> | | ||
| [route] | <code>string</code> \| <code>null</code> | <code>null</code> | | ||
| [api] | <code>ApiBlueprint</code> \| <code>null</code> | <code></code> | | ||
<a name="new_LambdaTest_new"></a> | ||
<a name="HandlerTester+queryStringParameters"></a> | ||
### new LambdaTest([blueprintFile]) | ||
### handlerTester.queryStringParameters(query) ⇒ <code>this</code> | ||
Sets query string | ||
**Kind**: instance method of [<code>HandlerTester</code>](#HandlerTester) | ||
| Param | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| query | <code>Object</code> \| <code>null</code> | <code></code> | the query string | | ||
| [blueprintFile] | <code>string</code> | <code>null</code> | api blueprint | | ||
<a name="HandlerTester+body"></a> | ||
<a name="LambdaTest+_getBlueprint"></a> | ||
### handlerTester.body(body) ⇒ <code>this</code> | ||
Sets request body | ||
### lambdaTest._getBlueprint() ⇒ <code>ApiBlueprint</code> | ||
**Kind**: instance method of [<code>LambdaTest</code>](#LambdaTest) | ||
<a name="LambdaTest+test"></a> | ||
**Kind**: instance method of [<code>HandlerTester</code>](#HandlerTester) | ||
### lambdaTest.test(handler, [routeOrStatus], [httpMethod], [statusCode]) ⇒ [<code>HandlerTester</code>](#HandlerTester) | ||
Create test and checks for status code | ||
when first parameter is API path, response is checked against api blueprint | ||
**Kind**: instance method of [<code>LambdaTest</code>](#LambdaTest) | ||
| Param | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| body | <code>Object</code> \| <code>string</code> | <code></code> | request body | | ||
| handler | <code>function</code> | | function to test | | ||
| [routeOrStatus] | <code>number</code> \| <code>string</code> | <code>200</code> | route path for blueprint or status code | | ||
| [httpMethod] | <code>string</code> | <code>null</code> | http method to use | | ||
| [statusCode] | <code>number</code> \| <code>null</code> | <code></code> | expected status code | | ||
<a name="HandlerTester+headers"></a> | ||
### handlerTester.headers(headers) ⇒ <code>this</code> | ||
Set request headers | ||
**Kind**: instance method of [<code>HandlerTester</code>](#HandlerTester) | ||
| Param | Type | Default | | ||
| --- | --- | --- | | ||
| headers | <code>Object</code> \| <code>null</code> | <code></code> | | ||
<a name="HandlerTester+pathParameters"></a> | ||
### handlerTester.pathParameters(params) ⇒ <code>this</code> | ||
**Kind**: instance method of [<code>HandlerTester</code>](#HandlerTester) | ||
| Param | Type | Default | | ||
| --- | --- | --- | | ||
| params | <code>Object</code> \| <code>null</code> | <code></code> | | ||
<a name="HandlerTester+run"></a> | ||
### handlerTester.run() ⇒ <code>Promise.<Object></code> | ||
Send request | ||
**Kind**: instance method of [<code>HandlerTester</code>](#HandlerTester) | ||
<a name="HandlerTester+verify"></a> | ||
### handlerTester.verify() ⇒ <code>Promise.<Object></code> | ||
Send request | ||
**Kind**: instance method of [<code>HandlerTester</code>](#HandlerTester) | ||
----------------- | ||
# API | ||
<a name="HandlerTester"></a> | ||
@@ -136,0 +101,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
731
0
37815
179