Using QUnit for WordPress testing

I’ve been interested in testing and automated testing for a while (one of my gigs when I was freelancing was to create automated tests using CasperJS for WordPress sites) but I couldn’t find the time to research on how unit testing is done on WordPress.

Even there’s a dedicated page for Automated Testing in the core handbook, the information is pretty lacking at the moment (something to work with and fix in the future), so setting everything up was not the easiest task. Looks like the testing is done via two testing frameworks, PHPUnit for PHP tests and QUnit for Javascript tests.

I’ve been playing with Hello Dolly and integrating QUnit into the plugin, so is nothing fancy but just some spaghetti code here and there to make it run.

You can find the plugin code in my GitHub here: Repository

QUnit and Javascript WordPress testing