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

Simple Serverless tester, which works like this:

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-30%
Maintainers
1
Weekly downloads
 
Created
Source

Lambda test

Simple Serverless tester, which works like this:


const lambdaTest = require('lambda-test');
const { getById } = require('../../routes/users.js');

describe('GET /users/{id}', () => {

    it('should get user by id', async () => {
        const response = await lambdaTest(getById)
            .pathParameters({ id: 123 })
            .run();
    })
});


API

HandlerTester

Kind: global class

new HandlerTester(handler, [statusCode], [httpMethod])

ParamTypeDefault
handlerfunction
[statusCode]number | null
[httpMethod]string | nullnull

handlerTester.queryStringParameters(query) ⇒ this

Sets query string

Kind: instance method of HandlerTester

ParamTypeDefaultDescription
queryobject | nullthe query string

handlerTester.body(body) ⇒ this

Sets request body

Kind: instance method of HandlerTester

ParamTypeDefaultDescription
bodyobject | stringrequest body

handlerTester.headers(headers) ⇒ this

Set request headers

Kind: instance method of HandlerTester

ParamTypeDefault
headersobject | null

handlerTester.pathParameters(params) ⇒ this

Kind: instance method of HandlerTester

ParamTypeDefault
paramsobject | null

handlerTester.run() ⇒ Promise.<object>

Send request

Kind: instance method of HandlerTester

handlerTester.verify() ⇒ Promise.<object>

Send request

Kind: instance method of HandlerTester

Keywords

FAQs

Package last updated on 01 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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