An Xcode extension (plugin) to generate Swift test doubles automatically.
var a = "abc"
var a = [0, 1, 2]
var a = A()
as
or is
expression. var a = b as String
or var a = b is Bool
var a = (0, true)
Important
Mojave now requires apps to request permission when automating other apps. This app automates Xcode to find the open project directory. Starting with this release you must select OK for the '"Swift Mock Generator for Xcode" wants access to control "Xcode"' alert when you open the app. Check System Preferences -> Security & Privacy -> Privacy -> Automation
and make sure Swift Mock Generator
is allowed to control Xcode.
This is the first release to support mocking classes 🎉
Please note that note that properties with inferred types are not yet supported and are ignored. Mocks with these items should still compile. Support for these are coming soon.
Release notes:
private
, fileprivate
, static
, and final
are ignored.var myProp: String = ""
private(set)
, fileprivate(set)
are supported.var myProp: String { return "" }
var myProp: String {
get { return otherValue }
set { otherValue = newValue }
}
Thanks to everyone who filled out the survey. It's given me a good idea what to build next... starting with this performance improvements release. The survey is still open if you want to help shape this project. Class support is my next focus.
Release notes:
I have 5 multiple choice questions for you to help make this plugin better. 60 seconds of your time will really help! Take the survey. Answers are completely anonymous - thanks in advance!
Release notes:
Breaking changes
myMock.shouldInvokeEmptyClosure = true
This release swaps SourceKit for a custom Swift parser. This is a huge change so please raise any new issues that you find.
Also in this release:
Any
.Note: where
clauses are not supported yet.