Skip to content
Discussion options

You must be logged in to vote

Hi @katovBash, in our view the most optimal implementation of the testValue of a dependency is the one that simply performs an XCTFail in every single endpoint, or uses the unimplemented helper to stub any kind of closure with one that performs XCTFail under the hood. This is what we do in our standups demo app:

https://github.com/pointfreeco/standups/blob/e130ec11cbd7de569256373fb177ae7cbdb470a0/Standups-StackBased/Standups/Dependencies/SpeechClient.swift#L72-L76

static let testValue = SpeechClient(
  authorizationStatus: unimplemented("SpeechClient.authorizationStatus", placeholder: .denied),
  requestAuthorization: unimplemented("SpeechClient.requestAuthorization", placeholder: .denied),

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@katovBash
Comment options

@katovBash
Comment options

@mbrandonw
Comment options

@katovBash
Comment options

Answer selected by katovBash
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
Converted from issue

This discussion was converted from issue #2217 on June 21, 2023 14:45.