monkeyjs
v3.6.1
Published
Monkey backend: Data mapping system
Downloads
3
Readme
Mock
Monkey backend: Data mapping system
Installation
npm install --save monkeyjs
Usage
var Mock = require('monkeyjs');
// create mock with data directory
var mock = new Mock('./data-dir');
// get mock data by HTTP request
var data = mock.get({
"uri": "/deal/123456",
"method": "POST",
});
For implementation detail, see docs, for more example, see test.
Misc
- test: npm test
- coverage: npm run test-cov
- benchmark: npm run benchmark
Benchmark
mock:benchmark benchmark start +0ms
mock:benchmark 100 times execution for each test +2ms
mock:benchmark / +3s
mock:benchmark /shop/123 +41ms
mock:benchmark /ktv/check/123 +9s
mock:benchmark /ktv/orderinfo/123 +4s
mock:benchmark /ktv/return/fail +26ms
mock:benchmark /ktv/orders +18s
Contribute
- Install git-hooks
- Execute
git hooks install
- Write function
- Write unit test
- Create pull request
NOTE: Never create pull request with failed tests.