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.
Written by Hwan-Joon Choi
Related protips
2 Responses
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
·
./node_modules/karma/bin/karma start --single-run --browsers PhantomJS
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Testacular
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#