In React, what's the easiest way to test a thunk creator (would you import it within a React component, or is there another, easier way to test whether the thunk creator is effectively making the POST/PUT/GET/DELETE request)?
The easiest way to test a thunk creator is to test whether the thunk creator is effectively making the post/put/get/delete request. The reason is obvious because importing react component usage is different as following. When one transform the code to React from the code which is written in JSX elements and subsequently createElememt calls, while calling importing react helps, if one don't import react component, createElememt call will fail as it will be undefined. So testing whether the thunk creator is effectively making the requests is the easiest way to check.
Get Answers For Free
Most questions answered within 1 hours.