I was looking at an AI generated PR. It was changing two test cases to mock a fu...

@kasperd@westergaard.social

I was looking at an AI generated PR. It was changing two test cases to mock a function.

  • Neither test case would ever have reached the function being mocked.
  • If they had reached that function they would have failed because the return value used by the mock was invalid.
  • There never was any need to mock that function in the first place. The original function is fast and has no side effects, letting a test case call it directly would have just worked.