npm
npm install wil-api-test --save-dev
yarn
yarn add wil-api-test --save-dev
"scripts": {
...
"api-test": "wil-api-test src --baseURL axios_base_url"
}
<@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>