Swift Testing

Use when Swift tests are written, migrated or reviewed and the risk is a test that passes while asserting nothing, hangs, or fails only in parallel: XCTest assertions inside Swift Testing tests or #expect inside an XCTestCase (cross-library issues and the interoperability mode), migrating an XCTestCase to a suite, setUp and tearDown versus init and deinit, #expect versus #require and why a pre-evaluated Boolean gives an empty failure, testing errors and optionals, async tests with await, confirmation and its expected count, wait(for:) versus fulfillment(of:) in async XCTest code, completion handlers bridged with a continuation, time limits, injected clocks instead of sleeps, tests that run in parallel in one process and share state, the serialized trait, main-actor isolation of test functions, and leak checks.

techmefr Updated

File contents

techmefr/mentis commit 4e10d61705

Frequently asked questions

npx get-skill add techmefr/swift-testing