-
|
Hi, I am using a database interface in the context of a procedure and I want to mock the interface in the tests by using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Yes, you can override the context when calling a procedure with const output = await link.call(['procedure'], { value: 123 }, { context: { db: mockDb } })If you need to intercept or manipulate context more deeply, you can use middleware with For mocking procedures, the recommended approach is to use the There are no indications that context is locked or cannot be set—passing a custom context per invocation is supported by design. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Maybe client context can help: https://orpc.unnoq.com/docs/client/server-side#client-context |
Beta Was this translation helpful? Give feedback.
Maybe client context can help: https://orpc.unnoq.com/docs/client/server-side#client-context
Or you can pass context each time you invoke a procedure: https://orpc.unnoq.com/docs/client/server-side#using-the-call-utility