Skip to content

How to mock @Dependency(MyDependency.self) #175

Answered by stephencelis
shimastripe asked this question in Q&A
Discussion options

You must be logged in to vote

@shimastripe We should add docs here, but you can use the subscript:

 withDependencies {
-  $0.apiClient.get = { _ in }
+  $0[APIClient.self].get = { _ in }
 } operation: {
   MyModel()
 }

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shimastripe
Comment options

Answer selected by shimastripe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants