WORK IN PROGRESS
For now, clone this repo and install the required modules with yarn or npm, and link:
$ yarn install
$ yarn link
Now you have the mockingbird cli
Prepare a json file with the following format:
//mock.json
{
"8080": {
"GET /numbers": [1, 2, 3, 4, 5]
},
"8081": {
"POST /login": {
"token": "fkj34rDjhf",
"logged": true
}
}
}
It is a dictionary with the port you want to follow where the values are dictionaries with the method and the path you want to mock with the respective response. Now execute the following command on terminal:
$ mockingbird mock.json
If we do a GET on localhost:8080/numbers, we have [1, 2, 3, 4, 5] as response
$ yarn test
MIT