-
Book Overview & Buying
-
Table Of Contents
Mastering Swift 6 - Seventh Edition
By :
Swift Testing and the older XCTest can be built within the same test target and coexist within the same test bundle. If our project already contains an XCTest bundle, there's no need to create a new Unit Testing Bundle to use Swift Testing. We can add new Swift Testing files to the existing target. Over time, we can convert your existing XCTest-based tests to Swift Testing, allowing for a seamless transition from XCTest to Swift Testing.
There are multiple methods for adding a Swift testing target to a project. In this section, we will look at how to add a Swift testing target to both an existing XCode project and an existing Swift project created with the Swift Package Manager. Let's start off by adding a testing target to an existing XCode project.
The following steps outline how to add swift testing to an existing XCode project:
From the top menu, select File>New>Target

In the template filter type “...