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'
],
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…