msw Questions

2

Solved

So i am writing tests for one of my react projects and i just decided to use mock service worker to mock my api calls and i am trying to mock a login endpoint.So i am trying to simulate a login err...
Arioso asked 30/11, 2021 at 8:8

4

I'm trying to test a component in React that uses RTK Query + MSW + Vitest. It works fine on the browser but while testing RTK Query with vitest it throws this error: { status: 'FETCH_ERROR', error...
Brei asked 9/1, 2023 at 11:5

2

This is the first time when I setup test environment with RTK Query and mock server (msw). Please tell me what I'm doing wrong. Environment Name Version msw 1.2.1 react 18 redux toolkit...
Fugacity asked 18/4, 2023 at 15:41

3

I have a working react app, where I use msw for mocking BE in browser and in tests (Jest). With msw v1.3.0 everything works perfectly fine, I've decided to update it v2.0 and there I've encountered...
Reparable asked 25/10, 2023 at 10:50

1

I have built a ReactJS application using Vite, and I am testing my application using Vitest. I make heavy usage of react-query within my application. For mocking network requests during testing, I ...
Usually asked 20/3, 2023 at 20:34

1

Solved

I am using MSW to mock server requests. I recently updated to v2, after which began seeing a module not found error when trying to import setupServer from the msw/node import path. I can see the fi...
Bottrop asked 1/11, 2023 at 0:49

2

I use msw with Next js. But at First render, cannot connect api this is index.tsx import { useQuery } from "@tanstack/react-query"; import axios from "axios"; const Home = () =...
Archespore asked 28/9, 2022 at 10:28

1

I'm integrating a mock API which basically send a response object with a set of messages that are supposed be shown in the UI(Chatbox) along with Username, user pic and so on. I'm having some troub...
Gethsemane asked 2/3, 2023 at 11:0

1

I'm trying to figure out how to mock calls to the auth0 authentication backend when testing a next js app with React Testing Library. I'm using auth0/nextjs-auth0 to handle authentication. My inten...
Teethe asked 4/2, 2022 at 1:11

3

I have created a Create React App application with typescript template build in, then i installed MSW with npm and created files based on MSW install guide. It's working perfectly for jest, but for...
Amaleta asked 15/12, 2021 at 12:31

2

Solved

In my tests using Supertest and MSW I've noticed that, although they still pass successfully, MSW has started showing warnings for the requests that Supertest is making. For example (see files to r...
Spiegeleisen asked 17/6, 2021 at 18:42

1

Solved

I'm struggling mocking the SWR fetch api call with MSW. You can reproduce the issue with this repo: https://github.com/charitha95/msw-test Error that I'm facing when using MSW: Error: connect ECON...
Headstrong asked 27/8, 2022 at 18:56

2

Solved

I am running jest test suites for a Next.js app that uses Redux Toolkit. I'm using msw to mock any necessary calls to another api outside of the Next app that are handled by Redux Toolkit. I have n...
Stockroom asked 3/6, 2022 at 15:11

1

I'm getting the ECONNREFUSED error and it looks like my msw server isn't catching my get request when I start a get outside of a React component (which shaves some time off of the response). When a...
Longtin asked 21/4, 2022 at 21:37

2

Solved

I have an RTK Query mutation endpoint rejectApplication, that invalidates the getApplication query. These are in the same API. rejectApplication: builder.mutation<RejectResponse, string>({ q...
Raccoon asked 8/12, 2021 at 11:36

1

Solved

I have a page with a dropdown component being loaded into it. This component calls a customhook that uses react query to get data to show in the dropdown. On initial load this component is in a loa...
Sites asked 25/2, 2021 at 9:23
1

© 2022 - 2024 — McMap. All rights reserved.