Embracing the Messiness in Search of Epic Solutions

Tag: JavaScript

  • Why I Am Switching to Karma

    OVERVIEW JavaScript testing is hard. Most of the time, it is just plain difficult to set up the test harness just to run Javascript tests. CURRENT STATE Most of my team’s existing production web applications do not use any MV* frameworks. A few newer projects use Backbone/Marionette. We rely on the following stack:- We choose… Read More…

  • Jenkins: Getting Karma Generated Test Results to Appear in Maven Project Job

    PROBLEM Jenkins, for some reason, does not pick up Karma generated JUnit test reports even though they are created in the right directory… and apparently, it is a known problem. While Freestyle project job allows us to manually publish these JUnit reports, my intention is to rely on Maven project job to do the same… Read More…

  • IntelliJ : Karma Integration

    Overview Although we can run karma start karma.conf.js on the command line to start Karma test runner, JetBrains provides a great Karma-IntelliJ integration to run and display the JavaScript test results within IntelliJ. Prerequisites Install Karma Plugin in IntelliJ The first step is to install the Karma plugin created by JetBrains. Create Karma “Run” Configuration… Read More…

  • Karma: Getting Started

    Overview This tutorial walks through the steps need to configure Karma to work with a Maven web project. It will also be used as a base for my future Karma related posts. Install Node.js First, download Node.js from http://nodejs.org/download/ and install it. Once installed, we should be able to invoke npm command from the command… Read More…

  • Combining and Minifying JavaScript Files with Google Closure Compiler

    GOAL The goal is to combine and minify several JS files into one JS file in the right order. PROBLEM Let’s assume we have the following directory structure with three JS files. Directory Structure appdev.js appdev.blackcow.js appdev.whitesheep.js SOLUTION To pull this off, we will leverage Google Closure Compiler. There are multiple ways to use this… Read More…

  • Managing the Order of AJAX Calls on Input Field’s Keyup Event

    SCENARIO Consider the following code:- When user types an employee’s name, “Mike”, in the search field, a web service call is fired per character typed. In this example, the following web service calls are made:- Let’s assume this web service searches the input string against databases (or flat files, Facebook API, etc) and returns a… Read More…