Comparing version 0.7.1 to 0.7.3
@@ -39,2 +39,3 @@ 'use strict'; | ||
wrapped.__original = original; | ||
wrapped.__unwrap = function () { | ||
@@ -41,0 +42,0 @@ if (nodule[name] === wrapped) nodule[name] = original; |
{ | ||
"name": "shimmer", | ||
"version": "0.7.1", | ||
"version": "0.7.3", | ||
"description": "Safe(r) monkeypatching for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,6 +17,6 @@ 'use strict'; | ||
test("should wrap safely", function (t) { | ||
t.plan(6); | ||
t.plan(8); | ||
t.equal(counter, generator.inc, "basic function equality testing should work"); | ||
t.doesNotThrow(function () { generator.inc(); }); | ||
t.equal(counter, generator.inc, "method is mapped to function"); | ||
t.doesNotThrow(function () { generator.inc(); }, "original funciton works"); | ||
t.equal(1, outsider, "calls have side effects"); | ||
@@ -35,3 +35,5 @@ | ||
t.doesNotThrow(function () { generator.inc(); }); | ||
t.ok(generator.inc.__wrapped, "function tells us it's wrapped"); | ||
t.equal(generator.inc.__original, counter, "original function is available"); | ||
t.doesNotThrow(function () { generator.inc(); }, "wrapping works"); | ||
t.equal(2, count, "both pre and post increments should have happened"); | ||
@@ -38,0 +40,0 @@ t.equal(2, outsider, "original function has still been called"); |
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
18093
427