https://github.com/andyfinnell/testkit
Personal set of Swift testing utilities
https://github.com/andyfinnell/testkit
swift testing
Last synced: 5 months ago
JSON representation
Personal set of Swift testing utilities
- Host: GitHub
- URL: https://github.com/andyfinnell/testkit
- Owner: andyfinnell
- License: mit
- Created: 2021-07-05T14:08:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-20T22:33:55.000Z (over 1 year ago)
- Last Synced: 2025-03-18T07:44:19.290Z (10 months ago)
- Topics: swift, testing
- Language: Swift
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# TestKit
 [](https://github.com/apple/swift-package-manager)
TestKit is a Swift package to make testing with XCTest a tiny bit more ergonomic. It's an extraction of my personal set of testing utils so I don't have to copy-pasta them across projects.
## Requirements
- Swift 5.3 or greater
- iOS/tvOS 13 or greater OR macOS 10.15 or greater
## Installation
Currently, TestKit is only available as a Swift Package.
### ...using a Package.swift file
Open the Package.swift file and edit it:
1. Add TestKit repo to the `dependencies` array.
1. Add TestKit as a dependency of the target that will use it
```Swift
// swift-tools-version:5.3
import PackageDescription
let package = Package(
// ...snip...
dependencies: [
.package(url: "https://github.com/andyfinnell/TestKit.git", from: "0.0.1")
],
targets: [
.target(name: "MyTarget", dependencies: ["TestKit"])
]
)
```
Then build to pull down the dependencies:
```Bash
$ swift build
```
### ...using Xcode
Use the Swift Packages tab on the project to add TestKit:
1. Open the Xcode workspace or project that you want to add TestKit to
1. In the file browser, select the project to show the list of projects/targets on the right
1. In the list of projects/targets on the right, select the project
1. Select the "Swift Packages" tab
1. Click on the "+" button to add a package
1. In the "Choose Package Repository" sheet, search for "https://github.com/andyfinnell/TestKit.git"
1. Click "Next"
1. Choose the version rule you want
1. Click "Next"
1. Choose the target you want to add TestKit to
1. Click "Finish"