diff options
author | Johannes <mail@johannesewald.de> | 2012-06-04 03:50:51 +0400 |
---|---|---|
committer | Johannes <mail@johannesewald.de> | 2012-06-04 03:50:51 +0400 |
commit | b81a3fe886523d61d9f5d4ceb4b485e544612a60 (patch) | |
tree | 29034f28f3201540898de80a0e85b3026b2ecb26 | |
parent | 3cef6560f191b6647033f470b631762845b6f476 (diff) |
Update master
-rw-r--r-- | README.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -101,7 +101,7 @@ rewire("./myModuleA.js", null, null, null, false) !== require("./myModuleA.js"); - *{!String} filename*: Path to the module that shall be rewired. Use it exactly like require().
- *{Object} mocks (optional)*: An object with mocks. Keys should be the exactly the same like they're required in the target module. So if you write ```require("../../myModules/myModuleA.js")``` you need to pass ```{"../../myModules/myModuleA.js": myModuleAMock}```.
-- *{Object|String} injections (optional)*: If you pass an object, all keys of the object will be ```var```s within the module. You can also eval a string. **Please note**: All scripts are injected at the end of the module. So if there is any code in your module that is executed during ```require()```, your injected variables will be undefined at this point. For example: passing ```{console: {...}}``` will cause all calls of ```console.log()``` to throw an exception if they're executed during ```require()```.
+- *{Object|String} injections (optional)*: If you pass an object, all keys of the object will be ```var```s within the module. You can also eval a string. **Please note**: All scripts are injected at the end of the module. So if there is any code in your module that is executed during ```require()```, your injected variables will be undefined at this point. For example: passing ```{console: null}``` will cause all calls of ```console.log()``` to throw an exception if they're executed during ```require()```.
- *{Array<String>} leaks (optional)*: An array with variable names that should be exported. These variables are accessible via ```myModule.__```
- *{Boolean=true} cache (optional)*: Indicates whether the rewired module should be cached by node so subsequent calls of ```require()``` will return the rewired module. Further calls of ```rewire()``` will always overwrite the cache.
|