News for hackers. Stuff that matters.
Re:Programmers Should Never Trust Anyone, Not Even Themselves by bloopernova on Monday July 01, 2024 @11:31AM (#40846782)
I (sysadmin/devops) am writing some nodejs and the complexity of the tests is confusing to me. I'm a nodejs beginner to be sure, and I'm not experienced enough to verify what copilot gives me.

All those mocks, and other Jest code, all seem overly complicated but I don't know of anything "better".

Re:Programmers Should Never Trust Anyone, Not Even Themselves by throwaway2037 on Friday July 05, 2024 @03:48AM (#40880600)
Don't be ashamed of this. I am a veteran of automated testing (writing automated unit tests for 10+ years). I am constantly disappointed in myself how bloody complicated it is to test some "simple code". And, then I go back and look at old unit tests from a few months ago: "Who wrote this shit!? <git blame> Oh, me."