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:
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