Is it possible to mock/override while debugging using devtools?

150 Views Asked by At

I'm debugging using browser dev-tools. There is a if condition which I know is false in current setuo, but I want to debug into if block for some code execution checking. Is there a way to mock/override the return value of the function so that for that particular run debug flow would go into that if block.

if (isEnabled()) {
   // I want to go into this if block
   someFunc();
} else {
   // flow going here.
}

I want to mock isEnabled() so that I can go into if block without making a change in function in code and rerunning the request. I want to do it in debug flow it self.

0

There are 0 best solutions below