I do version control with Git, and unit testing with QUnit. Sometimes I find a bug in my software that was not present in a past version. It\'s easy for me to write a unit test
Use git bisect
for this, please see this page.
Since you're testing JavaScript, you will probably have to run the tests by hand and run git bisect good
and git bisect bad
as appropriate. However, if you can run your unit test from the command line, then you can use git bisect run
to have Git execute the test repeatedly and track down the faulty commit automatically:
$ git bisect run my-script.sh
That's pure magic the first time you see it! :-)