Meta Refresh 2015

The web in your pocket

Unit Testing CSS

Submitted by Leena S N (@leenasn) on Sunday, 8 February 2015

videocam_off

Technical level

Intermediate

Section

Workshops

Status

Submitted

Vote on this proposal

Login to vote

Total votes:  +5

Objective

This workshop gives an overview of unit testing, especially Test Driven Development and also shows that CSS can also be unit tested.

Description

Those who have written unit tests would know how much confidence it gives to the developers and how much it impacts maintainability due to frequent refactoring. And needless to say the faster feedback cycle it gives by following the “Red-Green-Refactoring”.

But for CSS usually the practice is to rely on end to end tools such as Selenium, which are brittle and slow.

Session Format

It will be a live coding session, based on the Sample setup which uses:

  • Quixote - Library for Unit Testing CSS
  • Mocha - Javascript Testing Framework which Quixote uses for running the tests in browser
  • Karma - the Test Runner, to run the tests across multiple web browsers, including mobile browsers

The format of the session will be:

  • Introduction to Unit Testing, specifically TDD, why its so important
  • Unit test [2-3 trivial cases where CSS have logic, such as display block/none, position attribute with fixed value etc.]
  • Test Driving some of the CSS3 tricks, mentioned in https://github.com/rupl/fun-games-css
  • Introduction to tools like wraith, which can be used in complement to unit testing, for end to end testing including responsiveness
  • Suggestions on how to help the participants apply the above learnings on their daily work
  • Q&A

The session is open to anyone who has basic knowledge of CSS, Javascript and Git. If you are struggling to have high confidence about the reliability of every commits that you make to your repository, this session is for you. This session will help you to regain the confidence to push every commit to production.

Speaker bio

Leena is the Head of Engineering @ Multunus. She was bitten by the TDD bug a couple of years ago. Having done enough TDD in Ruby/Rails, Javascript and Android, she’s moved onto Continuous Delivery (CD) in a big way - even spoke about CD at DroidCon India 2011 and AgileIndia 2012. During the last couple of years, she had conducted workshops on TDD and CD during JSFoo, DroidCon and RootConf.

Comments

Login with Twitter or Google to leave a comment