Pure functions can’t directly mutate global variables, the arguments passed into them, the network, the disk, or the screen. All they can do is return a value.
Mocking is a Code Smell
Eric Elliott
11.9K69

Pure functions are really idempotent black boxes, like a mini-API. That’s really its power. Mocking is an “expense” with little or no direct benefit to software end users; so it should be minimized whenever possible. Can lead to “busy works” that contributed to little betterment of the software under test.