Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 527
Wagner Danda da Silva Filho Avatar asked Jun 14 '16 19:06

Wagner Danda da Silva Filho


1 Answers

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

like image 173
Estus Flask Avatar answered Sep 27 '22 17:09

Estus Flask