Replies: 1 comment
-
a) I'd advise doing myService.context(.test) { MyServiceSpy() } in setup() or in testServiceIsCalled(). You're only going to be able to define the extension with that name once. b) Doing let spyService = Container.shared.myService() resolves a new instance and is not the one injected when MyClass was created. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there, we are considering using Factory for our project and I'm trying to understand the best approach for testing dependent services callbacks. Imagine this scenario:
Then in my test case I would do
Can someone advise on what's generally the best approach here? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions