Hold on, surely QUnit automates the running of these tests for us anyway?
The answer is yes and no. QUnit automated the tests but only to an extent; we had to run the set of tests manually each time. This is all well and good, but you know what? I'm feeling lazy and don't have the time or inclination to continually run tests by hand, as I am sure you won't either. We can do better than this; it is possible to automate our testing using NodeJS/Grunt and PhantomJS.
Granted, it will take some effort to set up, but it is worth the time saved when tests run automatically as soon as any identified content has been altered.
Let's take a look at what is involved in automating our test:
We'll begin by installing NodeJS. To do this, browse to http://nodejs.org/ and download the appropriate binary for your system; it is available for Windows, Mac OS, and Linux.
Once installed, go ahead and open up the NodeJS command prompt and then change to the
qunit
folder we created at the...