melinda-api-mock
Version:
Mocks melinda api for tests
33 lines (18 loc) • 513 B
Markdown
A mock of melinda api. This module can be used to test things that depend on melinda api.
```
npm install melinda-api-mock
```
```
var MockAPI = require('melinda-api-mock');
var api = new MockAPI({
recordsDir: "records/" // a directory where to read the requested marcxml records from
});
```
The constructor returns an instance of [http.Server](https://nodejs.org/api/http.html#http_class_http_server)
```
// to start the api:
api.listen(port, cb);
```