How to test axios with config option
问题 I'm trying to test the below axios request written for both put/post as a config option: export function saveCourse(course){ const config = { method: course.id ? 'PUT' : 'POST',// POST for create, PUT to update when id already exists. url: baseUrl + (course.id || ''), headers: { "content-type": "application/json" }, data: course } return axios(config) .then((res) => { if(res.status === 201 || res.status === 200) return res.data; if(res.status === 400){ const error = res.text(); throw new