From 0af1dcb6b2ccbc7ec0ae757549688e666cf569a7 Mon Sep 17 00:00:00 2001 From: Johannes Date: Mon, 11 Jun 2012 23:29:10 +0200 Subject: - changed API - introduced __set__ and __get__ to rewired modules --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/index.js') diff --git a/lib/index.js b/lib/index.js index 8be8897..a6dbcd6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -13,14 +13,14 @@ var rewireModule = require("./rewire.js"); * @param {Boolean} cache Indicates whether the rewired module should be cached by node so subsequent calls of require() will return the rewired module. Subsequent calls of rewire() will always overwrite the cache. * @return {*} the rewired module */ -function rewire(request, mocks, injections, leaks, cache) { +function rewire(request, cache) { delete require.cache[__filename]; // deleting self from module cache so the parent module is always up to date if (cache === undefined) { cache = true; } - return rewireModule(module.parent, request, mocks, injections, leaks, cache); + return rewireModule(module.parent, request, cache); } rewire.reset = rewireModule.reset; -- cgit v1.2.3