1.0.4-0 • Published 6 years ago

mockutil v1.0.4-0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

A simple mockjs extended app

install

use npm:

npm install mockutil -D

use yarn:

yarn add mockutil -D
use
  1. touch mock.json
[
  {
    "url": "test/lib1",
    "method":"post",
    "template":{
      "string":"post"
    }
  },
  {
    "url": "test/lib2",
    "method":"get",
    "template":{
      "string":"get"
    }
  }
]
  1. import mockutil
const MockUtil = require('mockutil');
const json = require('./test.json');
  1. Instantiate objects
const mockutil = new MockUtil(json);
  1. replace your fetch/axios/request with mockutil instance
mockutil.get('test/lib2').then(res => {
  // balabala
})
1.0.4-0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago