When migrating to Swift Testing, mixing dependency injection patterns with the new test lifecycle caused inconsistent behavior. Swift Testing creates fresh instances more aggressively than older patterns, so dependencies that assumed reuse broke unexpectedly. The fix is to align object construction with the test lifecycle by building all dependencies fresh per test, eliminating reuse assumptions and restoring predictable behavior.

1m watch time

Sort: