Book Image

PhantomJS Cookbook

By : Rob Friesel
Book Image

PhantomJS Cookbook

By: Rob Friesel

Overview of this book

Table of Contents (15 chapters)
PhantomJS Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Running Jasmine unit tests with Grunt


In this recipe, we will learn about using Grunt to execute our Jasmine unit tests from the command line. Grunt is a popular JavaScript task runner and is useful for automating repetitive operations, such as scaffolding, minification, linting, and testing, on the command line.

Getting ready

To run this recipe, we will need the following items:

  • JavaScript code to test, and the tests for that code

  • Node.js and npm installed and on our PATH

    Note

    The Node.js package manager is npm; it is used to download and install Node.js packages for use in our projects. It is included as part of the core Node.js platform. The typical pattern for using npm looks like this:

    npm <command> [<options>] [<package-name>]
    

    For more information, enter the following on the command line:

    npm help
    
  • The Grunt task runner (grunt-cli)

    Note

    Grunt is a popular JavaScript task runner for the command line. We can find out more about it at http://gruntjs.com/; we can install the...