Book Image

PhoneGap By Example

Book Image

PhoneGap By Example

Overview of this book

Table of Contents (17 chapters)
PhoneGap By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Testing with DalekJS in a real browser


All these testing things are really helpful, but it will be even better if we are able to run a real browser and control it. With DalekJS, this is possible. It's really a nice Node.js module that comes with the command-line interface tool and submodules for the major browsers such as Google Chrome, Firefox, and, Internet Explorer.

Let's install the Dalek CLI:

$ npm install -g dalek-cli

DalekJS supports several browsers including Google Chrome, so we will use it. Of course, we should have it installed onto our system. Once the Dalek CLI is installed, let's create a folder for our test and put package.json there with the following content:

{
    "name": "DalekJS-Test",
    "description": "DalekJS Test Description",
    "version": "0.0.1",
    "devDependencies": {
        "dalekjs": "*",
        "dalek-browser-chrome": "*"
    }
}

A quick npm install command will create the node_modules directory with both dependencies inside.

Tip

DalekJS has a good documentation...