My notes on making unit tests that works in xCode and terminal
Steps
- Terminal: swift package init
- Make XCode MacOS unit-test target in the xcode project
- Remove references of the unit-test folders xXode created
- Move the test folder into
Tests/
folder and drag it into xcode (in copy bundle resources remove the info.plist) - In the xCode unit-test-target set the info.plist filepath to
Tests/NameOfProjectTests/info.plist
- In the package.swift make sure the testTarget name matches the Test target name
Examples:
These can be unit tested from xcode and terminal: