Karma Testrunner Logo

Karma very slow on Chrome? Don't run it in background tab!

Very recently I started to use the very nice Karma Test Runner. I really do recommend to check it out. However I wondered why tests ran very slow sometimes (>20s) and sometimes they where very fast (<1s). Quickly I realised the issue was having the Chrome tab in the background: The Chrome tab which was connected to Karma was one among others. I used the other tabs for web browsing and development, so the Karma tab wasn’t the active tab. This gives it a very low priority and running tests became extremely sluggish. ...

July 25, 2013 · 1 min · Nils
AngularJS Logo

AngularJS: Send auth token with every request

AngularJS is an awesome javascript framework. With it’s $resource service it is super fast and easy to connect your javascript client to a RESTful API. It comes with some good defaults to create a CRUD interface. However if you are using an API, which needs authentication via an auth token, you might run into issues: The resource factory creates a singleton. If you do not already have an auth token when the factory is called, or if the auth token changes afterwards, you cannot put the auth token as a default request parameter in the factory. ...

July 5, 2012 · 6 min · Nils