Empezar
Auto-Generate a MockAPI Server for Your Mobile APP

Auto-Generate a MockAPI Server for Your Mobile APP

Mobile Mock Server — Auto-Scaffolded from Your Own API Calls React Native / iOS / Android: One-Command Mock Server for UI Tests ``` Why: leads with the outcome ("auto-generate a mock API server"), names the audience (mobile) and the use (UI tests / API), so it's searchable.
#Ingeniería#Producto#Productividad
Valoración
Se necesitan más valoraciones
Vendidos
1
Cómo se usa
Descargar

Mobile apps run in simulators and emulators — they can't use in-process mocking like MSW.
You need a real HTTP server on a known port, and building one by hand means reading every
network call in your codebase and writing a route handler for each. **This skill does all
of that wiring for you.** Point it at your project root; it reads how your app talks to
its backend and generates a complete, runnable mock server — then tells you exactly how
to run it.

### ✅ What you get
- **Auto-detected platform** — React Native (Expo or bare), native iOS, or native Android
- **Endpoint discovery from your real code** — it scans `fetch` / `axios` /
  `api`/`apiClient` instances / React Query / RTK Query (RN), `URLSession` / Alamofire /
  Moya (iOS), Retrofit / OkHttp / Ktor / Fuel (Android)
- **Route handlers + realistic fixtures** — one per endpoint, immutable, matching your
  app's actual response shapes (ISO dates, pagination wrappers, fictional IDs)
- **A full `/__mock/*` control API** — global error injection
  (`POST /__mock/error` / `clear`), per-route stubs (`POST /__mock/scenarios`), network
  faults (`POST /__mock/fault`), and a **request journal** (`GET /__mock/requests`) to see
  exactly what your app called when a test fails
- **Multi-backend support** — hits more than one API? It generates one server per backend
  plus a gateway that proxies by path and broadcasts control calls
- **Exact run commands** — the server is its own package; `npm install && npm start`

### 🧩 Asks before it assumes
It auto-detects what it can and **asks you for the rest** — where the server package
should live, which port to use, which backends to include. No silent defaults, no config
file to maintain.

### 🔌 Standalone, but harness-ready
The `/__mock/*` control surface it emits is the exact contract an agent testing harness's
shared-mock package uses — so the server runs on its own today, and the same files drop
into a harness later with **no protocol change**. On request it also emits a thin harness
adapter (`test/mock-adapter/index.js`) a harness runner can launch per repo.

### 🛡️ Safe by default
It shows the full plan and asks before writing anything. It writes **only** under the
mock-server directory you choose — **no changes to your app source code**, and **no new
dependencies in your app** (the server is its own self-contained CommonJS package with its
own `express`).

### 🧪 Why it works
The generated server speaks the **WireMock-style admin pattern** the industry already
uses for stub management and request journaling — battle-tested mechanics, not a toy:
- Global error injection short-circuits every request (test 401/404/500 with one call)
- Per-route stubs + path-parameter matching (`/api/users/:id` matches `/api/users/123`)
- Network faults: timeout, connection reset, empty response
- A queryable request journal so a failing UI test can answer "what did the app actually
  hit?" — filter by `?unmatched=true`, `?path=`, `?method=`, `?since=`

### ▶️ What you run
It **scaffolds and instructs** — it writes the server and the exact run commands, then you
run `npm start` in the generated directory and point your test build at the port. It does
**not** start the server itself (a mock server is a long-running process you own).

### 📋 Requirements
- A React Native, iOS, or Android project
- Node.js >= 18 (to run the generated server)