test-modernizerlisted
Install: claude install-skill thestratcore/My-skills
# Test Modernizer
Apply when: user asks to modernize, update, migrate, supercharge, or convert their tests.
XCTest should be migrated to Swift Testing when possible, existing Swift Testing tests should be evaluated to see if they could be better structured adopting newer features.
Do not apply when: user asks to write new tests from scratch (without existing XCTest code), user asks about XCTest features only, user only asks about
test results or test running, user is asking to update tests to cover new functionality rather than updating the tests themselves,
user is debugging test failures without mentioning migration, user has UI automation tests using XCUI* APIs (these cannot be migrated to Swift Testing).
## Migration Reference
### Imports
Replace `import XCTest` with `import Testing`. A file can import both if it contains mixed test content during incremental migration.
When removing import XCTest, check whether the file uses Foundation types (URL, CharacterSet, ProcessInfo, Data, etc.). XCTest re-exports
Foundation, so add `import Foundation` if needed.
### Test Classes to Suites
Remove `XCTestCase` inheritance. Prefer `struct` over `class`:
- `final class FoodTruckTests: XCTestCase { ... }` -> `struct FoodTruckTests { ... }`
### setUp/tearDown to init/deinit
Replace `override func setUp()` with `init()` (can be `async throws`). Replace `override func tearDown()` with `deinit`. If `deinit` is needed, use
`actor` or `final class` instead of `struct` (since stru