Why do we still need custom assertions when #𝑒π‘₯𝑝𝑒𝑐𝑑 is already more informative than XCTest? The key: use π‘†π‘œπ‘’π‘Ÿπ‘π‘’πΏπ‘œπ‘π‘Žπ‘‘π‘–π‘œπ‘› to report failures at the call site, not inside helpers. For complex validation, 𝐼𝑠𝑠𝑒𝑒.π‘Ÿπ‘’π‘π‘œπ‘Ÿπ‘‘ is the way to go.

πŸ”—: https://qualitycoding.org/swift-testing-custom-assertions/ by Jon Reid (@qcoding)

#SwiftTesting #Swift #iOSDev

How to Make Custom Test Assertions in Swift Testing

Stop chasing test failures through helper functions. Here's how to write custom Swift Testing assertions that report errors exactly where they belong.

Quality Coding