If you don't believe this, just write some (good) unit tests, then make the change - it's very very likely they will catch some weird corner case you've forgotten even existed.
More green checks = more dopamine Higher quality code = long term satisfaction.
Code does things, tests verify that it does the things I thought it did. Getting a bit of validation makes me feel good while working.
If it now needs to do completely different things then it needs different tests.
Also, if you are making huge changes to tests whenever you change a single detail, that's an issue with your code, not testing in general.
Type checks are good too. Using a typed language is even better.
I'm not an all-TDD-all-the-time type by any means. You kind of have to at least have something to start writing tests against or it'll just be compiler errors all day long. But for the projects where I've most consistently found success in building correct systems, writing tests as soon as the basic interfaces are in place has resulted in more flexible, more reliable tests that last over the long term.
As for type checks...isn't that what a compiler is for?
That's literally the thesis of the Kent Beck book.
I'm not some idiot copy and pasting `expect(true).toEqual(true)`
I add functionality one test at a time. I get satisfaction of knowing it works as specified in the form of an increasing count of green checks.
I don't understand why it would alienate me.
Edit: I get that logically they are the same, but that's true of a half-empty/half-full glass. Psychologically they are different.
As you say, you don't care that there are 20k passing tests. You care just care that there is 1 failure.
If you first write the test and then try to satisfy them(test driven development) can work to an extent as it can divide the large task into small pieces where you get a prize each time but it also alienates the developer from the larger picture, diminishing their value to the project since they no longer can put their intellectual output into the project.