New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

fake-express-http

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

fake-express-http

Fake Express HttpRequest and HttpResponse for unit testing.

latest
Source
npmnpm
Version
1.3.1
Version published
Weekly downloads
5
-85.29%
Maintainers
1
Weekly downloads
 
Created
Source

Fake Express HTTP

Circle CI

Fake Express HttpRequest and HttpResponse for unit testing. Supports Express 4, requires Node 4.x or newer.

Supports asynchronous functions by returning a promise from response.onEnd().

Includes fake and real tests using same controllers to ensure fake is accurate.

What is a Fake?

The real thing is substituted by a fake. Where as mocks only partially substitute aspects of the real thing.

Fakes ahear to Liskov substitution principle.

State of the Art

The existence of this library is justified, as state of the art libraries are deficient.

  • node-mocks-http (AKA express-mocks-http)
    • Does not support Express 4.
  • mock-express-request + mock-express-response
    • Unit testing requires both a fake request and response. Should be a single library.
    • Node.js Stream API callback style events are exposed to allow for asynchronous testing.
    • As a result does not support promises and has a leaky abstraction with a Stream API finish event.

Keywords

fake

FAQs

Package last updated on 21 Jan 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