You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This replaces`console` just inside`myModule`. That is, because rewire is using`eval()` to turn the key expression into an assignment. Hence, calling`myModule.__set__("console.log", fn)` modifies the`log` function on the*global*`console` object.
157
190
158
-
**Globals with invalid variable names**<br>
159
-
rewire imports global variables into the local scope by prepending a list of`var` declarations:
160
-
161
-
```javascript
162
-
var someGlobalVar=global.someGlobalVar;
163
-
```
164
-
165
-
If`someGlobalVar` is not a valid variable name, rewire just ignores it.**In this case you're not able to override the global variable locally**.
166
-
167
-
**Special globals**<br>
168
-
Please be aware that you can't rewire`eval()` or the global object itself.