All Projects → eshengsky → chrome-extension-mocker

eshengsky / chrome-extension-mocker

Licence: MIT license
The most convenient tool to mock requests for axios, with built-in Chrome extension support.

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
SCSS
7915 projects

Projects that are alternatives of or similar to chrome-extension-mocker

umock-c
A pure C mocking library
Stars: ✭ 29 (-21.62%)
Mutual labels:  mock, mocking, mock-library
Axios Mock Adapter
Axios adapter that allows to easily mock requests
Stars: ✭ 2,832 (+7554.05%)
Mutual labels:  mock, mocking, axios
Msw
Seamless REST/GraphQL API mocking library for browser and Node.js.
Stars: ✭ 7,830 (+21062.16%)
Mutual labels:  mock, mocking, mocking-library
mockingbird
🐦 Decorator Powered TypeScript Library for Creating Mocks
Stars: ✭ 70 (+89.19%)
Mutual labels:  mock, mocking, mock-library
Mockito
Most popular Mocking framework for unit tests written in Java
Stars: ✭ 12,453 (+33556.76%)
Mutual labels:  mock, mocking, mock-library
Mockiato
A strict, yet friendly mocking library for Rust 2018
Stars: ✭ 229 (+518.92%)
Mutual labels:  mock, mocking
Okhttp Json Mock
Mock your datas for Okhttp and Retrofit in json format in just a few moves
Stars: ✭ 231 (+524.32%)
Mutual labels:  mock, mocking
Faker
Provides fake data to your Android apps :)
Stars: ✭ 234 (+532.43%)
Mutual labels:  mock, mocking
Vue Element Admin
🎉 A magical vue admin https://panjiachen.github.io/vue-element-admin
Stars: ✭ 73,044 (+197316.22%)
Mutual labels:  mock, axios
Mockery
A mock code autogenerator for Golang
Stars: ✭ 3,138 (+8381.08%)
Mutual labels:  mock, mocking
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+9218.92%)
Mutual labels:  mock, mocking
wwvue-cli
vue-cli升级版脚手架,应有尽有的开箱即用方法及配置,没有花里胡哨的晦涩难懂的操作,上手成本极低,现已新增simple(极简模式)、vue3和iview-template,是个很不错的垫脚石,来不及解释了赶紧上车😊😘
Stars: ✭ 15 (-59.46%)
Mutual labels:  mock, axios
kugou
multiple implementations for kugou music
Stars: ✭ 25 (-32.43%)
Mutual labels:  mock, axios
Pester
Pester is the ubiquitous test and mock framework for PowerShell.
Stars: ✭ 2,620 (+6981.08%)
Mutual labels:  mock, mocking
Sinon Jest Cheatsheet
Some examples on how to achieve the same goal with either of both libraries: sinon and jest. Also some of those goals achievable only by one of these tools.
Stars: ✭ 226 (+510.81%)
Mutual labels:  mock, mocking
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+583.78%)
Mutual labels:  mock, mocking
aem-stubs
Tool for providing sample data for AEM applications in a simple and flexible way. Stubbing server on AEM, no separate needed.
Stars: ✭ 40 (+8.11%)
Mutual labels:  mock, mocking
springmock
alternative spring mocking infrastructure
Stars: ✭ 22 (-40.54%)
Mutual labels:  mock, mocking
electron-admin-antd-vue
Electron Vue3.x Ant Design Admin template
Stars: ✭ 21 (-43.24%)
Mutual labels:  mock, axios
Nx Admin
👍 A magical 🐮 ⚔ vue admin,记得star
Stars: ✭ 2,497 (+6648.65%)
Mutual labels:  mock, axios

chrome-extension-mocker

A mock tool based on Chrome extension, no need to change any code, support dynamic mock data.

If you want to use v1 version, switch to axios-mocker branch.

Why need mock requests

  • Instead of waiting for the dependent web service to develop and deploy, you just need to define the interface fields and the front back end can be developed in parallel.
  • Some web service may contaminate the data in the production environment, while the real request will not be sent by simulating the request and specifying the response you want.
  • Many times, the web service may return various types of responses, and developers and testers need to verify if it is working correctly under different returns, for example, when web service status code is 500, the page can be displayed as expected. Creating the data through normal operations can sometimes be particularly cumbersome or difficult, while using mock requests is convenient, and boundary testing can be done efficiently if you want to return what you want.
  • It is the base of TDD (test-driven development) and automated testing.

Preview

Download

Download from Chrome Web Store.

Or, download and install as following:

  1. Download the latest package in Release page.
  2. Open Chrome, enter chrome://extensions/ in the address bar to enter the Chrome extension page, and check the Developer mode.
  3. Drag the downloaded zip file to the page, and click on the Add Extension button.

Usage

In Chrome browser, press Ctrl+Shift+I or ⌘+⌥+I to open dev tools, go to Mocker panel.

Click the New button, and enter the mock data you want. In Match Request panel, set which requests need to match, and in Mock Response panel, set the simulate response you want to return.

Note that if one request is matched, the original request will be redirected into a data uri, you can see details in Console panel.

Development

$ yarn serve

Package

$ yarn build

Example

$ cd example
$ node server.js

Visit http://localhost:8369/example/index.html.

Licence

MIT License

Copyright (c) 2021 Sky.Sun 孙正华

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].