JavaScript Code Coverage Dashboard with Codecov.io

.

It is a truth universally acknowledged, that a single function critical to the success of the application, must be in want of a unit test. A practical way to prevent the lack of a unit test is to ensure that the overall code coverage does not regress. Fortunately, for applications written in JavaScript, there are… Read more »

Autodetect JavaScript TDD/BDD Library

.

A unique feature of Venus.js, a JavaScript test runner from LinkedIn, is that the test configuration can be in the form of source annotation. This is useful, e.g. to choose which test library (Mocha, Jasmine, QUnit) should be used to execute the tests. Now, wouldn’t it be fantastic if the test runner can deduce the… Read more »

JavaScript Unit Tests and Code Coverage Tracking using Venus.js

.

These days, having enough unit tests for a JavaScript-based web application/library is the bare minimum. Ideally, the code coverage of those tests is also monitored in a day-to-day development situation. Fortunately, this is easy to do with a modern test runner such as Venus.js. Named after the famous Venus flytrap, Venus.js was originated at LinkedIn… Read more »

Tracking JavaScript Annotations

.

One of the interesting features of Esprima is to retrieve every comment inside a JavaScript source. Even better, each comment can be linked to the related syntax node. This is very helpful (like in the case of JSDoc) since any additional information regarding the program can be provided via the comment serving as a form… Read more »

Code Coverage of Mocha Tests using Istanbul and Karma

.

Many JavaScript projects are using Mocha to run the unit tests. Combining Mocha with Istanbul and Karma, it is easy to track the code coverage of the application code when running the tests. While Mocha has a built-in support for running the tests from the command-line via Node.js, in some cases you still want to… Read more »

Code Coverage of QUnit Tests using Istanbul and Karma

.

QUnit, used by projects like jQuery and jQuery Mobile, is a rather popular JavaScript testing framework. For tests written using QUnit, how do we measure its code coverage? A possible solution which is quite easy to setup is to leverage the deadly combination of Karma and Istanbul. Just like our previous adventure with Jasmine code… Read more »