Mirage JS
miragejs.com
- Free plan
- Web
What Mirage JS is
Mirage JS is a free, MIT-licensed JavaScript library for mocking backend APIs during frontend development and testing. Running in the browser, it intercepts XMLHttpRequest and fetch requests and returns responses defined by the application. Routes, models, relationships, serializers, an in-memory database, factories, and fixtures help create dynamic records and lists. Handlers support every HTTP verb, simulated delays, and custom errors, allowing interfaces to be exercised with empty data, failures, or slow responses. Mirage has separate development and test uses; its test environment disables delays and logging and ignores development seeds. It is used with React, Vue, and Angular applications, with guides for Cypress and React Testing Library. Teams can install it through npm or Yarn, work offline without environment variables or auth tokens, and share prototypes without backend services. REST and GraphQL are supported. Node use requires a browser-like environment such as jsdom, and production exclusion is recommended unless prototyping.
Who it suits
Mirage JS suits frontend developers and testers who need configurable API behavior without running backend services. It fits JavaScript projects using frameworks or test tools covered by its guides.
Good to know, and what to watch
- Free and MIT licensed
- Intercepts fetch and XMLHttpRequest requests
- Dynamic data through database and factories
- Supports REST and GraphQL
- Works in development and testing
- Node requires a browser-like environment
- Cannot mock server-side API requests for React apps
- Production exclusion is recommended unless prototyping
The verdict
Mirage JS provides browser-based API mocking with dynamic data, route behavior, and testing integrations. Its runtime boundary and production guidance should be considered when planning server-side or deployed use.
What the maker publishes
- Development and testing
- Mirage can be used in both development and testing, with a test environment that disables delays and logging and ignores development seeds. source
- Development and testing
- Mirage can be used in both development and testing to simulate server data and scenarios. source
- Dynamic data
- It includes an in-memory database and helper functions for simulating dynamic backend services. source
- Framework integrations
- The standalone library is used in JavaScript apps built with React, Vue, and Angular. source
- Frameworks
- The maker says Mirage works with all major JavaScript frameworks, libraries, and test runners; its about page names React, Vue, and Angular apps. source
- HTTP behavior
- Route handlers support all HTTP verbs, simulated response timing, and custom error responses. source
- Installation
- The installation guide provides npm and Yarn commands and directs users to quickstarts for their stack. source
- Integrations
- Official guides cover Cypress and React Testing Library. source
- License
- The GitHub repository identifies Mirage JS as MIT licensed. source
- Mock data
- Its in-memory database and factories can create records and lists for development and tests. source
- Offline development
- The maker says collaborators can install the frontend project and use a local offline development environment without environment variables or auth tokens. source
- Pricing and security
- The official documentation pages opened describe installation and library usage but do not state product pricing, trial terms, or security certifications. source
- Production use
- The application testing guide recommends excluding Mirage from production builds unless it is being used to build a prototype. source
- Prototype sharing
- Mirage can mock an entire API so teams can share a working JavaScript prototype without running backend services. source
- Purpose
- Mirage is a JavaScript library for mocking backend APIs during frontend development and testing. source
- Purpose
- Mirage JS is a client-side API mocking library for building, testing, and sharing JavaScript applications without relying on backend services. source
- Request interception
- It runs in the browser and intercepts XMLHttpRequest and fetch requests so apps can receive mocked responses. source
- Runtime limit
- The maker says Mirage runs in Node only in a browser-like environment such as jsdom, and cannot mock a React app's server-side API requests. source
- Server features
- Its conventions include routes, a database, models and relationships, factories, fixtures, and serializers. source
- Support
- The official site links to GitHub, Discord, and Twitter for community access. source
- Support resources
- The documentation site provides guides, a tutorial, API reference, quickstarts, and a REPL. source
- Testing integrations
- Official guides show Mirage working with Cypress, React Testing Library, and Vue Test Utils. source
- UI testing
- Mirage supports high-level UI tests against different API states, including empty data, errors, and slow responses. source
Checked against the maker's pages on 7 Oct 2026.