Jenkins CI is one of the most popular continuous integration servers. At some point while developing your Karma project, you might want to have automated tests run off your code versioning system. Jenkins will help you with this task. I assume you have Jenkins already setup and running on your CI environment.

Jenkins site

In Jenkins, start a new job for Karma with the basic settings:
Project name, Description

step 1

Source Code Management: File System (plugin File System SCM), Git, Subversion
Clear Workspace checkbox

step 2

Build periodically (for example every five minutes H/5 * * * *)

In Build Environment:

  1. Inject environment variables to the build process, checkbox in Build Environment
  2. Insert in Properties Content:
    1. PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
    2. PHANTOMJS_BIN=/Users/giuseppecilia/testingJavascriptKarma/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs #or wherever PhantomJS happens to be installed

step 3

In Execute shell of Build section write karma start

step 4

In Action after Build, select Publish JUnit test result report and insert testjs/*.xml (enter the path to where the test-results.xml is relative to the root of your Jenkins job workspace)
Retain long standard output/error checkbox
Save

step 5

share me!:))Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone
Print this page