# MakeAWishFoundation/SwiftyMocky

Framework for automatic mock generation. Adds a set of handy methods, simplifying testing. One of the best and most complete solutions, including generics support and much more.

Repository: https://github.com/MakeAWishFoundation/SwiftyMocky
Canonical: https://ross.abutalabs.com/products/swiftymocky
Language: Swift
License: MIT
License Family: permissive
Topics: mock, generating-mocks, swift, unittest, xcode9
Last push: 2024-09-02T12:14:45+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3302, "days_push": 730, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1085, forks 140 (observed 2026-08-28T04:03:31.606839+00:00)

## What it is
SwiftyMocky is a strongly typed Swift framework that automatically generates mock implementations of protocols using Sourcery code generation. It provides Mockito-like Given/Verify/Perform APIs to simplify unit testing in Swift projects.

## Use cases
- generate mocks for swift protocols automatically
- stub return values in swift unit tests
- verify method invocations in tests
- mock generics in swift
- reduce boilerplate in ios unit testing
- mockito-style testing in swift

## When to choose
- you write Swift unit tests with many protocol dependencies
- you want automatic mock code generation instead of hand-written mocks
- you need generics support and strongly typed stubbing/verification

## When to avoid
- your project is not in Swift or not built with Xcode/SwiftPM tooling
- you prefer runtime mocking without a code generation step
- you need mocking for non-protocol constructs like classes without abstractions

## Facets
- artifact type: framework
- maturity: active
- function: mocking, testing
- domain: testing, developer-tools, mobile-development
- platform: cli
- tags: swift, mock-generation, sourcery, unit-testing, xcode, protocol-mocking, codegen, ios, macos

## Member repositories
- MakeAWishFoundation/SwiftyMocky (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:31.606839+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:49:41.352370+00:00, confidence not recorded.
  - readme: https://github.com/MakeAWishFoundation/SwiftyMocky (fetched 2026-08-28T04:03:31.606839+00:00, sha 7a8a7b27ea87)
- Data as of 2026-08-30T08:39:29.467469+00:00.
