Last Updated: February 25, 2016
· hc5duke

Using Karma/ with CircleCI

At Distill we began using AngularJS, and went with Testacular/Karma for our testing needs. To get this working on CircleCI, I played around with circle.yml file a little bit and came up with this:

    - npm install -g karma
    - nohup bash -c "karma start spec/javascripts/testacular.conf.js &"
    - bundle exec rspec spec
    - karma run

The downside here is that the npm install -g karma step added almost 30 seconds to the total test suite. It's possible there might be ways to speed this up using caching between runs, but I haven't gotten around to looking into this yet.

2 Responses
Add your response

Two comment:
Installing dependencies as Karma should be installed in dependencies section.
To avoid installing karma each time, juste add cache section in dependencies section.

Ex of circle.yml :

   - npm install -g karma
    - ~/nvm
over 1 year ago ·

./node_modules/karma/bin/karma start --single-run --browsers PhantomJS

over 1 year ago ·