I never understood the whole religion around unit tests. Integration tests are often far easier to write and far more valuable.
Like you said, unit tests are really nice when testing for a known, expected output.
Unit tests that are effectively testing mocks and crazy stubs because your method has side effects? Not for me.
You need both unit tests and integration tests.
I have written a tool (also a script) myself that allows you to write unit tests, manage your scripts in git, load scripts in other scripts, etc. Maybe I will post a Show HN in the coming weeks, but at the moment I would like to round up some edges before posting it.
In my experience, the biggest problem is that there are many different runtime environments out there that differ in detail and make it hard to write scripts that run everywhere. But programmers not applying all their skills (e.g. writing tests) to build scripts are also part of the problem.