Relative Content

Tag Archive for unit-testingaxiosjestjstanstackreact-queryreact-native-testing-library

Testing component that is using axios and tanstack query

So I have a component that is using hook to get data from server. If data was fetched successfully component displays the list of item, if there was some errors component displays error message and while loading it displays loading spinner. That are exactly three components states that I want to test.
My hook to get data is using useQuery from @tanstack/react-query and axios.