Global variables in Karma test runner
You either declare that global variable within your test file: var global = “something”; describe(‘Your test suit’, function() { … }); or add a Javascript file where it’s defined to your karma.conf.js file: // list of files / patterns to load in the browser files: [ …, ‘file-containing-the-global-variable.js’ ],