Comments (3)
Yes, setting global.fetch was the problem.
Nope, the repo is just something I found while googling, I never found an official recommendation on how to test with hooks.
My modified solution doesn't rely on setting global.fetch, but does still use the cross-fetch library. I'll go ahead and make a pull request to illustrate.
from msw-trpc.
I found a better way of doing things that works with tRPC latest, I described it in trpc/trpc#5134 and closed that issue.
Would you be interested in an integration test contribution that covers react hooks?
from msw-trpc.
Hi thanks for your work! So just to make sure, the problem is with setting global.fetch like https://github.com/c-ehrlich/msw-trpc-example this example is showing?
Is this repo linked in the tRPC docs because I can't seem to find it?
Would you be interested in an integration test contribution that covers react hooks?
That would be nice, also we could add something about that to the readme?
from msw-trpc.
Related Issues (20)
- Support for createTRPCReact (react query) HOT 2
- Integrate with ladle HOT 1
- Is it possible to reproduce the case where the server side throws a TRPCError? HOT 6
- Call to GET http://127.0.0.1:49475/ not handled HOT 1
- Cannot run msw-trpc with vitest HOT 4
- `req.getInput()` should indicate that its return type is a promise for mutations HOT 2
- Support tRPC subscriptions (WebSockets) HOT 1
- trpc query firing before service worker is started HOT 2
- When output parser is used in the procedure, `ctx.data` argument type is unknown (invalid type) HOT 1
- bug: TRPCClientError: Invalid URL HOT 10
- Request: Example integration with Next and RTL
- `req.getInput` incorrectly typed for `query` HOT 2
- Compatibility with msw 2.0
- Merged routes not working with latest trpc and msw-trpc HOT 2
- Issues throwing errors in 2.0.0-beta.0 HOT 1
- Cannot trigger useQuery `error` or `isError` response in test HOT 2
- Support for V11 HOT 6
- Bug: `output` is used inside `getMutationInput`
- Support different mutation input types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msw-trpc.