Best practices for testing userscripts?

Oh, this is swatting flies with a sledgehammer for sure.

Test driven design (writing tests that fail first, then the code to make them pass) really does make for better code, though, if you’ve never tried it. It forces you to think through the design more, and the huge payoff comes when you start refactoring and optimizing: After coding the simplest possible thing to make the tests pass, you know the tests work, so you can hack away at your code without worrying too much about unknowingly breaking functionality.