Mastering Web Application

(Rick Simeone) #1
Chapter 2

While we've selected the build tools that in our opinion are the best for
the purpose of the sample project, we do realize that different projects
will use different tools. The rest of this book and the recommendations
from this chapter should still be relevant and easily adaptable to
different build systems.

Grunt.js

The build system of the sample SCRUM application is powered by Grunt
(http://gruntjs.com/). The grunt.js is advertised as:


"A task-based command line build tool for JavaScript projects."

What is important for us is that grunt.js build scripts are written in JavaScript and
executed on the node.js platform. This is very good news as it means that we can
use the same platform and the same programming language for both building and
running the sample application.


The Grunt belongs to the same category of task-oriented build tools as Gradle
(scripts written in Groovy) or Rake (scripts written in Ruby), so people familiar
with those tools should feel at home.


Testing libraries and tools

AngularJS uses, promotes and encourages automated testing practices. The AngularJS
team takes testability very seriously, and they made sure that code written using
AngularJS is easy to test. But the whole testability story doesn't stop here, as the
AngularJS team written or extended tools in order to make testing easy in practice.


Jasmine

The tests for the AngularJS code base were written using Jasmine (http://pivotal.
github.com/jasmine/). Jasmine is a framework for testing JavaScript code and has
its roots in the Behavior Driven Development (BDD) movement which has influence
on its syntax.


All the examples in the original AngularJS documentation are using Jasmine's syntax
so this testing framework is a natural choice for our sample application. Moreover,
AngularJS have written various mock objects and Jasmine extensions to provide a
nicely integrated, practical day-to-day testing experience.

Free download pdf