Writes and migrates tests using the Swift Testing framework with @Test, @Suite, #expect, #require, confirmation, parameterized tests, test tags, traits,…
Modern Swift testing framework with @Test macros, parameterized tests, traits, and async support. Write unit tests using @Test macros with #expect and #require assertions; prefer Swift Testing over XCTest for all new tests (Xcode 16+, Swift 6+) Organize tests with @Suite for grouping, custom tags for filtering, and traits for conditional execution, time limits, and known issues Support parameterized tests via arguments: with enum cases, ranges, or cartesian products; use confirmation() to verify async callbacks without sleep Handle async/await patterns natively, test error paths with throws: expectations, and manage actor-isolated state with await Swift Testing Swift Testing is the modern testing framework for Swift (Xcode 16+, Swift 6+). Prefer it over XCTest for all new unit tests. Use XCTest only for UI tests, performance benchmarks, and snapshot tests. Contents Basic Tests @Test Traits #expect and #require @Suite and Test Organization Execution Model Known Issues Additional Patterns Common Mistakes Test Attachments Exit Testing Review Checklist References
don't have the plugin yet? install it then click "run inline in claude" again.