MockingKit icon indicating copy to clipboard operation
MockingKit copied to clipboard

MockingKit is a Swift SDK that lets you easily mock protocols and classes in `Swift`.

MockingKit Logo

Version Swift 5.6 MIT License Twitter: @danielsaidi

About MockingKit

MockingKit is a Swift-based mocking library that makes it easy to mock protocols and classes, for instance when unit testing or mocking not yet implemented functionality.

MockingKit lets you register function results, invoke functions and inspect calls.

MockingKit doesn't put any restrains on your code or require you to structure it in any way. You don't need any setup or configuration. Just create a mock and you're good to go.

Supported Platforms

MockingKit supports iOS 9, macOS 10.10, tvOS 9 and watchOS 6.

Installation

MockingKit can be installed with the Swift Package Manager:

https://github.com/danielsaidi/MockingKit.git

or with CocoaPods:

pod MockingKit

You can also clone the repository and build the library locally.

Getting started

The online documentation has a getting-started guide that will help you get started with the library.

Documentation

The online documentation has articles, code examples etc. that let you overview the various parts of the library.

The online documentation is currently iOS-specific. To generate documentation for other platforms, open the package in Xcode, select a simulator then run Product/Build Documentation.

Demo Application

This project contains a demo app that lets you explore MockingKit on iOS and macOS. To run it, just open and run Demo/Demo.xcodeproj.

Support

You can sponsor this project on GitHub Sponsors or get in touch for paid support.

Contact

Feel free to reach out if you have questions or if you want to contribute in any way:

License

MockingKit is available under the MIT license. See the LICENSE file for more info.