Refactoring javascript for unit testing · HackerTrans