You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{beforeEach,describe,expect,test,vi}from'vitest'import{createUser,fetchUsers}from'./users.service'importaxiosfrom'axios'vi.mock('axios')describe('Users Service',()=>{describe('fetchUsers',()=>{test('makes a GET request to fetch users',async()=>{constusersMock=[{id: 1},{id: 2}]axios.get.mockResolvedValue({data: usersMock,})})})})
The text was updated successfully, but these errors were encountered:
How to Mock redaxios like in this code
The text was updated successfully, but these errors were encountered: