wil-api-test
v1.3.0
Published
**npm**
Downloads
5
Readme
API test
npm
npm install wil-api-test --save-dev
yarn
yarn add wil-api-test --save-dev
Example
package.json
"scripts": {
...
"api-test": "wil-api-test src --baseURL axios_base_url"
}
Create file testing: example foo.test.api.js
<@received>
// using axios ( not import )
const { data } = axios.get("API ENDPOINT OR URL");
const result = data[0];
return result;
</@received>
<@expected>
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}
</@expected>