miragejs
parrot
miragejs | parrot | |
---|---|---|
17 | 1 | |
5,286 | 136 | |
0.3% | -0.7% | |
4.3 | 6.8 | |
17 days ago | 3 days ago | |
JavaScript | JavaScript | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
miragejs
-
Exploring Mirage JS: Simplifying API Mocking in React Development
Mirage JS GitHub Repository
- Mock server
-
The Definitive Guide to Make API Calls in React
For the styles, I'll be using TailwindCSS. To simulate API requests Mirage JS will be used, which is a very easy to use and useful API mocking library. To call this API, we're going to use Fetch.
-
e2e testing setup and thoughts on Playwright
during development we use mirage JS to spin up an in-browser mock server which returns mock data for any API endpoints not currently implemented by the real backend. during integration testing we configure this server to return mock data for all API endpoints in the system, giving us a fixed environment against which our tests can run. test suites can be run in parallel since each time a playwright page is opened a new copy of the webapp, and thus a new copy of the mock server, is launched. these integration tests run whenever a frontend PR is opened or updated.
-
How do you practice with React without setting up your own backend?
Mirage JS is specifically built for this purpose as well. It‘s a frontend JavaScript library meant for mocking backend APIs. https://miragejs.com/
We use miragejs https://miragejs.com/
-
Do tests without seeing the code!
The best case scenario you would be using something like MirageJS, MSW, or even JSON Server, but mocking fetch is always an option.
-
Mock server while developing
Mirage JS is pretty useful and allows you to create complex testing scenarios with its embedded db. Useful when you have relationships between your models.
-
Mocking API calls in React Tests with Nock
Mirage JS: Mirage JS is an API mocking library that lets you build, test, and share a complete working JavaScript application without having to rely on any backend services.
- How to correctly mock node-fetch?
parrot
What are some alternatives?
msw - Seamless REST/GraphQL API mocking library for browser and Node.js.
open-api-mocker - A mock server based in OpenAPI Specification
Nock - HTTP server mocking and expectations library for Node.js
axios-mock-adapter - Axios adapter that allows to easily mock requests
json-server - Get a full fake REST API with zero coding in less than 30 seconds (seriously)
mocko - Mocking made easy, proxy your API and choose which endpoints to mock
Express - Fast, unopinionated, minimalist web framework for node.
mockoon - Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
http-fake-backend - Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
prism - Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
eski - Eski is an undemanding mock server for developers and testers, that aims to abstract the complexities of coding a mock server into simple JSON configurations.