Comparing version 0.1.8 to 0.2.0
0.2.0 / 2014-02-21 | ||
================== | ||
* support thunkify cnpm/cnpmjs.org#196 | ||
0.1.8 / 2013-12-27 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -1,2 +0,2 @@ | ||
/*! | ||
/**! | ||
* mm - lib/mm.js | ||
@@ -20,2 +20,3 @@ * | ||
var semver = require('semver'); | ||
var thunkify = require('thunkify'); | ||
@@ -38,5 +39,11 @@ var mock = module.exports = function mock(obj, key, method) { | ||
} | ||
if (!callback) { | ||
throw new TypeError('Can\'t find callback function'); | ||
} | ||
// support thunk fn(a1, a2, cb, cbThunk) | ||
if (typeof args[index - 1] === 'function') { | ||
callback = args[index - 1]; | ||
} | ||
return callback; | ||
@@ -65,3 +72,3 @@ } | ||
timeout = timeout || 0; | ||
mock(mod, method, function () { | ||
mock(mod, method, thunkify(function () { | ||
var callback = getCallback(arguments); | ||
@@ -71,3 +78,3 @@ setTimeout(function () { | ||
}, timeout); | ||
}); | ||
})); | ||
return this; | ||
@@ -92,3 +99,3 @@ }; | ||
} | ||
mock(mod, method, function () { | ||
mock(mod, method, thunkify(function () { | ||
var callback = getCallback(arguments); | ||
@@ -98,3 +105,3 @@ setTimeout(function () { | ||
}, timeout); | ||
}); | ||
})); | ||
return this; | ||
@@ -101,0 +108,0 @@ }; |
This software is licensed under the MIT License. | ||
Copyright (C) 2012 - 2013 fengmk2 <fengmk2@gmail.com> | ||
Copyright (C) 2012 - 2014 fengmk2 <fengmk2@gmail.com> | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "mm", | ||
"version": "0.1.8", | ||
"version": "0.2.0", | ||
"description": "mock mate, mock http request, fs access and so on.", | ||
@@ -19,15 +19,17 @@ "main": "index.js", | ||
"dependencies": { | ||
"muk": ">=0.3.1", | ||
"semver": "~2.2.1" | ||
"muk": "0.3.1", | ||
"semver": "2.2.1", | ||
"thunkify": "0.0.1" | ||
}, | ||
"devDependencies": { | ||
"autod": "*", | ||
"blanket": "*", | ||
"contributors": "*", | ||
"should": "*", | ||
"travis-cov": "*", | ||
"node-patch": "*", | ||
"blanket": "*", | ||
"coveralls": "*", | ||
"mocha": "*", | ||
"mocha-lcov-reporter": "*", | ||
"pedding": "*", | ||
"mocha": "*" | ||
"node-patch": "*", | ||
"pedding": "0.0.3", | ||
"should": "3.1.2", | ||
"travis-cov": "*" | ||
}, | ||
@@ -34,0 +36,0 @@ "homepage": "http://github.com/fengmk2/mm", |
@@ -155,3 +155,3 @@ mm (美眉,Mock伴侣) [![Build Status](https://secure.travis-ci.org/fengmk2/mm.png)](http://travis-ci.org/fengmk2/mm) [![Coverage Status](https://coveralls.io/repos/fengmk2/mm/badge.png)](https://coveralls.io/r/fengmk2/mm) | ||
Copyright (c) 2012 - 2013 fengmk2 <fengmk2@gmail.com> | ||
Copyright (c) 2012 - 2014 fengmk2 <fengmk2@gmail.com> | ||
@@ -158,0 +158,0 @@ Permission is hereby granted, free of charge, to any person obtaining |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18484
327
3
10
+ Addedthunkify@0.0.1
+ Addedmuk@0.3.1(transitive)
+ Addedthunkify@0.0.1(transitive)
- Removedmuk@0.5.3(transitive)
Updatedmuk@0.3.1
Updatedsemver@2.2.1