Actually testing is as important as development and we all want to write code that works. So, why not test our front-end code?
To do that we can use some tools as Selenium, Jasmine but I will explain QUnit because it's used in Drupal8 testing.
QUnit is a powerful, easy-to-use JavaScript unit testing framework. It's used by the jQuery, jQuery UI, jQuery Mobile projects, also by Drupal, and is capable of testing any generic JavaScript code.
Session presented at Drupalcamp Gotemburg 2013 where I explained how to include QUnit testing in our Drupal projects.
11. We want
something like
Facebook, but we
need it yesterday.
And banners with
kittens. Everyone
loves kittens.
We should use
Comic Sans, it's
such a fancy and
funny font.
CustomersCustomers
40. Testing User ActionsTesting User Actions
this.bbq.val('Bacon').trigger('keyup');
QUnit.ok(this.bbq.val == 'Bacon',
Drupal.t('Barbecue with keyup.'));