Tests
Run XCTest, Swift Testing and UI tests from the Test Explorer, with failures marked on the failing line.
Your iOS project's unit and UI tests show up in VS Code's Test Explorer (the beaker icon in the activity bar). XCTest and Swift Testing are both supported, and a click runs them.
Finding tests
Tests are grouped by target › class › method. Swift Testing @Test functions are listed too, including ones with a display name. A run button sits in the gutter next to each test.
Running
- Click the run button next to a method, a class or a whole target to run just that.
- Tests run on the current run destination, a simulator or a device; UI tests run on devices too.
- Each test shows started, passed or failed live while the run is in progress.
- Failures are marked on the failing line, with the assertion message.
The scheme needs a test action (test targets checked in Xcode's scheme editor).