1.0.4-0 • Published 7 years ago

mockutil v1.0.4-0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 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

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago