vxntga
Last Updated: February 25, 2016
·
3.555K
· 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:

test:
  pre:
    - npm install -g karma
    - nohup bash -c "karma start spec/javascripts/testacular.conf.js &"
  override:
    - 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

12180

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 :

dependencies:
  pre:
   - npm install -g karma
 cache_directories:
    - ~/nvm
over 1 year ago ·
25182

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

over 1 year ago ·