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 Karma and PhantomJS from WebStorm


This recipe illustrates how to set up the Karma test runner to run within WebStorm so that we can receive feedback during development without leaving our IDE. WebStorm is an IDE by JetBrains that is focused on JavaScript development and other front-end technologies and tools.

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

  • The Karma test runner (and its supporting plugins/modules) installed

  • The WebStorm IDE

    Note

    WebStorm is an IDE by JetBrains that is oriented toward front-end developers and focused on JavaScript, CSS, and HTML. Support for the Karma test runner was added in version 7; we can find out more about WebStorm at http://www.jetbrains.com/webstorm/.

The library code that we will use for our tests is available in the downloadable code repository as string-utils.js under lib; the accompanying tests are available...