0.0.1 • Published 9 years ago

mock-plus v0.0.1

Weekly downloads
15
License
-
Repository
github
Last release
9 years ago

mock-plus

mock-plus is a encapsulation of mockjs, it will be more convenient to use mockjs with it.

  • toDoc(input, output) Aim to generate documentation to describe your interface input: give the path of your json file output: give the path where you wanna save the documentation
  • toMock(input, output) Aim to generate mock template input: give the path of your josn file output: give the paht where you wanna save the template
  • generator(input, output) Aim to generate mock data for testing input: give the path of your json file output: give the path where you wanna save the mock data
  • config(ops) Config the default rule for every type of data. According to mockjs, the types include: boolean, integer, float, string, array, object. Visit mockjs for detail.
  • getRule() You can use this method to see what default rules you will use to generate the mock data.

####You should know:

  • There is no default rules for array or object, because that may cause some unexpected problems such as some attributes get lost. so, be careful if you wanna add default rule for array or object.

based on macejson-parsermockjs