fake-clickbus-api
v0.1.31
Published
A nock for the clickbus api
Readme
fake-clickbus-api
A mock to test api requests and responses in the format described at http://docs.clickbus.com.br/
Install
npm i -D fake-clickbus-apiUsage
const request = require('request');
const fakeClickBus = require('fake-clickbus-api');
const CLICKBUS_URL = process.env.CLICKBUS_URL ||
'https://api-evaluation.clickbus.com.br/api/v1';
const scope = fakeClickBus(CLICKBUS_URL);
request(CLICKBUS_URL + '/places', function (error, response, body) {
console.log(response.body)
});
Contributing
non-npm requirements
install
git clone https://github.com/fczuardi/fake-clickbus-api.git
npm installpopulate fixtures
You might want to grab the real output from the actual API to populate the cached output of your fake mocked API. To do that use the tasks below:
places
npm run data:placestrips
npm run data:tripsTodo
- Currently the scripts to populate fixtures with real outputs are not available to the package distributed on npm. Maybe I'll include those shell scripts with the distribution later.
- Currently only some endpoints are mocked:
placesandtrips.
