Latest 0.2.3
License MIT
Platforms ios 8.0, requires ARC

[CI Status]( Armstrong/SuperMock)

A very simple yet powerful UI and Unit testing mock framework for API calls. It lives in your app and is completely offline.

  • Mock once, use forever.
  • Works offline
  • No Server
  • No Proxies
  • Pure Swift 4.2
  • Very flexible


To run the example project, clone the repo, and run pod install from the Example directory first.
Follow the Playground to learn how to use it.

Define any mocks for your application in a mocks plist file similar to the example included.

The plist file will contain a dictionary for each API call with an array of dictionaries with "data" for Response NSData and "response" for the HTTP Response Fields (plist file of http headers).

Enter 2 lines of code

let appBundle = NSBundle(forClass: AppDelegate.self)

Your URL requests throughout your existing code base will begin to return Mocks!


Record the Response and the headers using the recording functionality.

Enter 2 lines of code to start to record

let appBundle = NSBundle(forClass: AppDelegate.self)
SuperMock.beginRecording(appBundle, policy: .Override)

If the project bundle has a Mock.plist file, it will copy the file and fill the file with the new recorded urls.
If you do not have a Mock.plist file in your project it will create one.
You can specify the mock.plist file when you begin to record

SuperMock.beginRecording(appBundle, mocksFile: "NewMock", policy: .Record)

It is recording the data in the Documents folder of the mobile application, for example in the simulator:


The log of the recording will help to find the right folder


SuperMock is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SuperMock"


Michael Armstrong, @ArmstrongAtWork, Daniele Forlani


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

Latest podspec

    "name": "SuperMock",
    "version": "0.2.3",
    "swift_version": "4.2",
    "summary": "A very simple yet powerful UI and Unit testing HTTP mock framework. Lives in your app and runs offline.",
    "description": "A very simple yet powerful UI and Unit testing mock framework for API calls. It lives in your app and is completely offline. Setup your mocks at the start rather than on a per test basis.nInspired by the need for MOCKS in UI tests without the hassle of setting up per class mocks and wanting something very portable and retro-compatible with any codebase.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Michael Armstrong": "@ArmstrongAtWork"
    "source": {
        "git": "",
        "tag": "0.2.3",
        "branch": "master"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"

Pin It on Pinterest

Share This