3
abbasc
6y

Was working on fixing some test cases in js, tried everything i could but part of test case was never executing.
After couple of days of pulling my hairs, found someone had overriden the test lib methods by mistake😭😭

Comments
  • 0
    Wait, how??
  • 0
    @psukys in js, u can override anything including predefined libraries

    Try this in browser console :
    Math.floor = function() {
    console.log("hello world");
    }

    And now Math.floor() will always say "hello world" 😪
  • 0
    @abbasc I probably didn't emphasize where "how?" Points to 😅 I meant how come does production code override test code in your environment? :(
Add Comment