map-override
The map-override snippet overrides functions under Map.prototype to change their behaviour.
Parameters
|
Name |
Description |
Mandatory |
Default |
|---|---|---|---|
|
method |
The Map function to override: |
Yes |
n.a. |
|
needle |
String or regex used to determine which calls to trap. For |
Yes |
n.a. |
|
returnValue |
The return value for matched calls. For |
No |
'' |
|
path |
Path to look for the needle. Only relevant for |
No |
'' |
|
stack |
Comma separated list of strings to check in stack trace. |
No |
'' |
Filter examples
|
Filter |
Result |
|---|---|
|
|
Ignores |
|
|
Ignores calls where value matches the regex. |
|
|
|
|
|
|
|
|
Ignores |
Debugging
|
Message |
When |
Definition |
|---|---|---|
|
|
After wrapping |
Calls are intercepted. |
|
|
Needle matches set call |
The set call was ignored. |
|
|
Needle matches get call |
get returned the overridden value. |
|
|
Needle matches has call |
has returned the overridden value. |