Questions tagged [mswjs]

3 questions
1
vote
0 answers

SyntaxError: Unexpected string in msw

Recently i started getting this error for mock service worker (msw) in my react project. Details: Node v16.19.1 vite/3.2.6 linux-x64 node-v16.19.1 react 18.2.0 Checked google, github issues but no good.
targhs
  • 1,477
  • 2
  • 16
  • 29
1
vote
0 answers

Mocking odata endpoints in mswjs

Is it possible to mock odata endpoints using mswjs? I currently use json-server as my temporary backend until the odata endpoint is ready, at which point I’ll migrate my queries to use that. I plan to use mswjs to mock the server in my tests, but…
user24990
  • 13
  • 3
0
votes
1 answer

Mock Service Worker doesn't intercept request

app.js class MyApp { async fetchData() { const response = await fetch('http://myurl.com', { method: 'GET' }); console.log(response); // received: {}, expected: { val: true } } } export { MyApp }; app.test.js import {MyApp}…
elzoy
  • 5,237
  • 11
  • 40
  • 65