kentcdodds/testing-workshop

mockAxios V3

philippefutureboy opened this issue ยท 2 comments

Hi ๐Ÿ‘‹

I'd like to contribute the following version of the mock for axios.

This version enables the axios(config) API, like so:

import axios from 'axios';

axios({
  method: 'post',
  url: '/user/12345',
  data: {
    firstName: 'Fred',
    lastName: 'Flintstone'
  }
});

Let me know if that interests you!

Have a great day โ˜€๏ธ

That sure or not fully featured and would work well, but I prefer to keep the abstraction as simple as needed for the situation, so I don't think we'll make that change. Thanks anyway! Maybe you could make your code an open source package! (Though you may consider checking for existing packages that do the job first).

Great! Thanks for your answer :)