All Projects → lavyun → better-mock

lavyun / better-mock

Licence: MIT license
Forked from Mockjs, Generate random data & Intercept ajax request. Support miniprogram.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
HTML
75241 projects

Projects that are alternatives of or similar to better-mock

Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-65%)
Mutual labels:  mock, fake, mocking
Fake Xrm Easy
The testing framework for Dynamics CRM and Dynamics 365 which runs on an In-Memory context and deals with mocks or fakes for you
Stars: ✭ 216 (+54.29%)
Mutual labels:  mock, fake, mocking
Ts Auto Mock
Typescript transformer to unlock automatic mock creation for interfaces and classes
Stars: ✭ 204 (+45.71%)
Mutual labels:  mock, fake, 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 (+2362.86%)
Mutual labels:  mock, mocking, mock-data
Mockaco
🐵 HTTP mock server, useful to stub services and simulate dynamic API responses, leveraging ASP.NET Core features, built-in fake data generation and pure C# scripting
Stars: ✭ 213 (+52.14%)
Mutual labels:  mock, fake, mocking
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+80.71%)
Mutual labels:  mock, fake, mocking
mock-data
Mock data in PostgreSQL/Greenplum databases
Stars: ✭ 115 (-17.86%)
Mutual labels:  mock, mock-data
chrome-extension-mocker
The most convenient tool to mock requests for axios, with built-in Chrome extension support.
Stars: ✭ 37 (-73.57%)
Mutual labels:  mock, mocking
MockAlamofire
A simple example showing how to override the URLProtocol to return mock data on Alamofire responses. Helpful if you are looking for a simple way to mock an Alamofire response, with out any additional dependencies.
Stars: ✭ 22 (-84.29%)
Mutual labels:  mock, mocking
laika
Log, test, intercept and modify Apollo Client's operations
Stars: ✭ 99 (-29.29%)
Mutual labels:  mock, mocking
dexopener
An Android library that provides the ability to mock your final classes on Android devices.
Stars: ✭ 112 (-20%)
Mutual labels:  mock, mocking
jest-ts-auto-mock
Jest test utility with automatic mock creation for interfaces and classes
Stars: ✭ 150 (+7.14%)
Mutual labels:  mock, fake
open-api-mocker
A mock server based in OpenAPI Specification
Stars: ✭ 58 (-58.57%)
Mutual labels:  mock, mocking
factory
Generate lots of mock API data with ease.
Stars: ✭ 17 (-87.86%)
Mutual labels:  mock, mock-data
interface-forge
Graceful mock-data and fixtures generation using TypeScript
Stars: ✭ 58 (-58.57%)
Mutual labels:  mock, mock-data
miniprogram-network
Redefine the Network API of Wechat MiniProgram (小程序网络库)
Stars: ✭ 93 (-33.57%)
Mutual labels:  fetch, miniprogram
moq.ts
Moq for Typescript
Stars: ✭ 107 (-23.57%)
Mutual labels:  mock, fake
react-sync
A declarative approach to fetching data via a React higher order component
Stars: ✭ 18 (-87.14%)
Mutual labels:  fetch, ajax
fakey-json
This is a utility for mocking json data that pretends the api response data with JSON format.
Stars: ✭ 27 (-80.71%)
Mutual labels:  mock, fake
CNeptune
CNeptune improve productivity & efficiency by urbanize .net module with meta-code to lay foundation for frameworks
Stars: ✭ 30 (-78.57%)
Mutual labels:  mock, mocking

Build Status Coverage Status npm NPM npm type-coverage

介绍

better-mock fork 自 Mock.js,使用方法和 Mock.js 一致,用于 javascript mock 数据生成,它可以拦截 XHRfetch 请求,并返回自定义的数据类型。并且还支持主流小程序(微信、支付宝、头条、百度)。

文档介绍

更新日志

为什么有 Better-Mock ?

Mock.js 是一个很好的库,国内使用者众多,虽然该库几乎已经停止维护了,但是还是有很多使用者在提 issue 和 PR,这些问题都得不到有效的解决。而且在当前时代下,Mock.js 的构建工具、代码质量都显得很陈旧,所以 better-mock 将会在 Mock.js 的基础上进行迭代,持续修复 Mock.js 的众多issue,支持更多的新特性。

特点

  • 100% 兼容 Mock.js
  • 使用 typescript 进行重构,更好的代码提示。
  • 更加现代化的构建打包方案。
  • 更加完善的单元测试。
  • 支持对 fetch 的拦截。
  • 支持主流小程序(微信、支付宝、头条、百度)。

安装

npm install better-mock

使用

使用 better-mock 代替 mockjs

const Mock = require('better-mock')
Mock.mock({
  'list|1-10': [{
    'id|+1': 1
  }]
})

贡献指南

如果你想贡献自己的代码到 better-mock,请先仔细阅读这份贡献指南

License

Mock.js is available under the terms of the MIT License.

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].