Skip to content

Suddenly Getting Unimplemented: ContinuousClock.now On Every Test #1839

Answered by mbrandonw
david-hosier asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @david-hosier, this most likely has to do with the fact that when tests run in an app target (as opposed to framework or SPM library) the simulator actually starts up and executes your application's code. So, that code will think it's in a test context and access non-overridden dependencies, causing the failures.

Honestly, it's a huge gotcha that an application is running in the background, executing real life code. It means the simulator could be firing off network requests, tracking analytics events, and more, all without you knowing. TCA just happens to make this gotcha very in-your-face.

The best solution is to extract out basically all code from the app target into frameworks/libr…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@david-hosier
Comment options

@mbrandonw
Comment options

@david-hosier
Comment options

Answer selected by david-hosier
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