1.3.1 • Published 5 years ago

fake-express-http v1.3.1

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
5 years ago

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.
1.3.1

5 years ago

1.3.0

7 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago