Run angular code before Karma runs all the tests?

Is it possible to perform some kind of initialization coding in karma? I need to run such code before my tests are executed:

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

My application currently needs this module (and this constant), but today it is currently initialized in a funky way that my karma does not know about it.

+4
source share
1 answer

Like any other JS file, the initialization file must be specified in the Karma ( files) configuration , right before test/*.spec.js.

+4
source

All Articles