O'Reilly logo

PhantomJS Cookbook by Rob Friesel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required