0.1.31 • Published 8 years ago

fake-clickbus-api v0.1.31

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

fake-clickbus-api

A mock to test api requests and responses in the format described at http://docs.clickbus.com.br/

npm version Dependency Status devDependency Status Build Status Circle CI Build Status Codeship Status for fczuardi/fake-clickbus-api Code Climate Codacy Badge bitHound Overall Score License No Maintenance Intended

Install

npm i -D fake-clickbus-api

Usage

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 install

populate 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:places

trips

npm run data:trips

Todo

  • 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: places and trips.
0.1.31

8 years ago

0.1.30

8 years ago

0.1.29

8 years ago

0.1.28

8 years ago

0.1.27

8 years ago

0.1.26

8 years ago

0.1.25

8 years ago

0.1.24

8 years ago

0.1.23

8 years ago

0.1.22

8 years ago

0.1.21

8 years ago

0.1.20

8 years ago

0.1.19

8 years ago

0.1.17

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago