Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.45 KB

File metadata and controls

43 lines (31 loc) · 1.45 KB

How to Set a Default Reporter

Contents

One-Time Initialization in XCTest

Doing a one-time setup in XCTest requires two parts:

Create Initialization Class

XCTest has an init method that can do one-time setup. Here is an example:

public class TestSetup: NSObject {
    override init() {
        super.init()

snippet source | anchor

Set Initialization Class in Your Plist

Next, set this in your test Info.plist like this:

<key>NSPrincipalClass</key>
<string>$(TARGET_NAME).TestSetup</string>

snippet source | anchor


Back to README