record-http

Records incoming HTTP calls for testing

Usage no npm install needed!

<script type="module">
  import recordHttp from 'https://cdn.skypack.dev/record-http';
</script>

README

HTTP Request Recorder

Circle CI Dependency Status devDependency Status

records incoming HTTP calls

For black-box testing of network services.

Usage

In your test suite, set up a listener:

HttpRecorder = require('record-http')

listener = new HttpRecorder().listen(7777)

Now this instance records all calls made to port 7777. Access the recorded calls through:

listener.calls

More details around recording calls are here. You can reset the recorded calls (and keep listening for more) via

listener.reset()

An example is given here. Finally, close your instance through

listener.close()

More details around closing are here.

Development

See our developer guidelines