backdrop

JSON Fixture generation and rendering


License
ISC
Install
npm install backdrop@0.0.3

Documentation

Backdrop

npm version Build Status Code Climate

JSON fixture generation for integration testing apps which consume multiple remote APIs.

Installation

npm install --save-dev backdrop

In your application you need to mount Backdrop#app

var Backdrop = require('backdrop');
fixtures = new Backdrop();
myApp.use('/backdrop', fixtures.app);

Usage

To create an API, call Backdrop#load on the data and desired URL.

var Backdrop = require('backdrop');
fixtures = new Backdrop();
fixtures.load('your JSON', path_to_json);

To set the HTTP status code for an API you can use Backdrop#status. There does not have to be any JSON at the path for this to work.

fixtures.status(500, path_to_json);

Dependencies

  • express