Closed jack-michaud closed 1 year ago
Hi, this should already be the case, this is from the tests in this repo:
I will take a look at your repo.
This fix was already released in https://github.com/maloguertin/msw-trpc/releases/tag/v1.3.3 please upgrade your version :)
Describe the bug
req.getInput()
should indicate that its return type is a promise for mutations. Incorrect typing will also mean someone attempting to get the input without awaiting this promise will get unexpected behavior.To Reproduce Create a mocked server where a mutation is used.
Observe the warning:
'await' has no effect on the type of this expression.
An example repo can be found here. Link to the line with the warning
Expected behavior Since
getInput()
returns a promise for mutations, it the type returned fromgetInput()
should be a promise.Versions typescript: v5.0.4 tRPC: v10.22.0 msw: v1.2.1