Mastering Swift Testing: Migrating XCTest setUp/tearDown to init/deinit (with a caveat ⚠️)

Опубликовано: 24 Ноябрь 2024
на канале: Swift and Tips
618
19

In this video, we'll dive deep into the process of migrating your setUp and tearDown functions from the XCTest framework to init and deinit methods in Swift Testing.

This migration can help streamline your test suite, but there’s a crucial caveat you need to be aware before migrating tearDown to deinit. I’ll walk you through the potential pitfalls and share best practices to ensure your tests run smoothly and reliably.

Github Post: https://github.com/swiftlang/swift-te...
Migrating from XCtest: https://developer.apple.com/documenta...

Content:
0:00 - Intro
0:07 - Explaining setUp/tearDown
3:36 - Migrating to init
6:50 - Migrating to deinit
10:13 - Workaround deinit
12:44 - Outro

---

Previous Episode (Conditional Tests):    • Mastering Swift Testing: Conditional ...  
Swift Testing Playlist:    • Swift Testing  

OnlineStoreMV Project: https://github.com/pitt500/OnlineStor...
Xcode 16's Code Completion:    • First Look at Xcode 16's Code Complet...  


-----

Other videos from my channel:
Podcast:    • Swift and Tips Podcast  
any Protocol (Existential Types):    • "any" Keyword and Existential types i...  
The Composable Architecture (TCA):    • The Composable Architecture  
Apple Watch Layout using Geometry Reader:    • Building Apple Watch Layout with Geom...  
Key Paths:    • The Anatomy of a Key Path  
Result Builders:    • Result Builders in Action: Simplifyin...  
Types of Access Control:    • All types of Access Control in Swift ...  
Generics:    • Generics  

-----
My Contact:
https://www.swiftandtips.com
  / swiftandtips  
https://iosdev.space/@swiftandtips
  / pedrorojaslo