Remix.run Logo
jkool702 6 days ago

also re: BATS

Im aware of it, but have never ended up actually using it. Ive heard before the sentiment you imply - that its great for fairly simple script...but not so much for long and complicated scripts. And, well, the handful of bash projects that Ive developed enough to have the desire to add unit testing for are all range from "long and complicated" to "nightmare inducing" (lol).

Its on my "to try" list one day, but I have a sneaking suspicion that timep is not a good project to try out BATS for the first time on.

imiric 4 days ago | parent [-]

Yeah, I imagined Bats might be too limiting for a complex project such as yours. But in principle, it is simply a command runner that minimizes some of the boilerplate commonly used for testing. It's not even Bash-specific, and can be used to test any CLI program. I quite enjoyed using it for small personal scripts that are not throwaway, but don't need to be rewritten in a "proper" programming language either.

That said, migrating a large and purpose-built test suite to it would have no practical benefit, but it's worth considering for your next greenfield project. Cheers!