Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes <mail@johannesewald.de>2012-06-03 22:18:41 +0400
committerJohannes <mail@johannesewald.de>2012-06-03 22:18:41 +0400
commit07496ad0283cf5cc2184ecdf57b7d80cdc8348eb (patch)
treeda64eb0ef4a03b30720fcb10edabb851912d618c /lib/index.js
parentfb06490b1b810777ebf8f35cdc83875ccda893e8 (diff)
all tests up and running
Diffstat (limited to 'lib/index.js')
-rw-r--r--lib/index.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/index.js b/lib/index.js
new file mode 100644
index 0000000..f8f57ca
--- /dev/null
+++ b/lib/index.js
@@ -0,0 +1,13 @@
+"use strict"; // run code in ES5 strict mode
+
+var trick = require("./trick.js");
+
+module.exports = function (request, mocks, injections, leaks, 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 trick(module.parent, request, mocks, injections, leaks, cache);
+}; \ No newline at end of file