Execute angular code before Karma run all tests?

Is it possible to execute some sort of initialization coding in karma? I need to run a code like this before my tests get executed:

angular.module('module.common.brand', []).constant('BRAND', 'brandname');

My app currently requires this module (and this constant) but today this is currently initialized in a funky way that my karma doesn't know about it.

Upvotes: 7

Views: 4714

Answers (1)

Estus Flask
Estus Flask

Reputation: 222493

As any other JS file, initialization file should be specified in Karma configuration (files option), right before test/*.spec.js.

Upvotes: 6

Related Questions