Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lambda-test

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-test - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

4

bin/makeApiDoc.js

@@ -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",

@@ -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.&lt;Object&gt;</code>
* [.verify()](#HandlerTester+verify) ⇒ <code>Promise.&lt;Object&gt;</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.&lt;Object&gt;</code>
Send request
**Kind**: instance method of [<code>HandlerTester</code>](#HandlerTester)
<a name="HandlerTester+verify"></a>
### handlerTester.verify() ⇒ <code>Promise.&lt;Object&gt;</code>
Send request
**Kind**: instance method of [<code>HandlerTester</code>](#HandlerTester)
-----------------
# API
<a name="HandlerTester"></a>

@@ -136,0 +101,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc