# WeTransfer/Mocker

Mock Alamofire and URLSession requests without touching your code implementation

Repository: https://github.com/WeTransfer/Mocker
Canonical: https://ross.abutalabs.com/products/mocker
Language: Swift
License: MIT
License Family: permissive
Topics: wt-branch-protection-two-approvals, wt-branch-protection-exempt
Last push: 2024-12-11T15:19:36+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": 3333, "days_push": 630, "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 1190, forks 97 (observed 2026-08-28T04:03:55.903233+00:00)

## What it is
Mocker is a Swift library that mocks data requests from URLSession and Alamofire using a custom URLProtocol, without changing app code. It lets developers run networking unit tests offline with registered mock responses.

## Use cases
- mock URLSession requests in unit tests
- mock Alamofire requests without changing implementation
- run networking tests offline
- mock JSON API responses in Swift tests
- simulate delayed or redirect responses in tests
- mock requests based on file extension

## When to choose
- you write Swift unit tests that hit URLSession or Alamofire networking
- you want deterministic, offline network tests on Apple platforms
- you need to simulate delays, redirects, or specific response files

## When to avoid
- you need mocking for non-Apple platforms or non-Swift stacks
- you want full HTTP server simulation rather than URLProtocol interception
- your tests use networking libraries that bypass URL loading system protocols

## Facets
- artifact type: library
- maturity: active
- function: mocking, testing, http-client
- domain: testing, developer-tools, apis
- platform: -
- tags: urlsession, alamofire, urlprotocol, unit-testing, swift-package-manager, swift, ios, macos

## Member repositories
- WeTransfer/Mocker (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:55.903233+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:23:00.772156+00:00, confidence not recorded.
  - readme: https://github.com/WeTransfer/Mocker (fetched 2026-08-28T04:03:55.903233+00:00, sha 065520307b82)
- Data as of 2026-08-30T08:39:29.467469+00:00.
