Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getPreprocessorFactory() {
var factory = preprocessor.createPreprocessor;
if (!arrayEquals(factory.$inject, api)) {
console.log('incompatible karma preprocessor: found', factory.$inject, 'expected', api);
throw new Error('incompatible karma preprocessor');
}
return factory;
}
export function run(config: Util.Config, outputFile: string) {
Globals.Configure({ outputFile: outputFile });
var di = require('di');
new di.Injector([{
emitter: ['type', require('karma/lib/events').EventEmitter],
config: ['value', Util.getKarmaConfig(config)],
preprocess: ['factory', require('karma/lib/preprocessor').createPreprocessor],
fileList: ['type', require('karma/lib/file_list').List]
}]).invoke(discoverTests);
}
function run(config, outputFile) {
Globals.Configure({ outputFile: outputFile });
var di = require('di');
new di.Injector([{
emitter: ['type', require('karma/lib/events').EventEmitter],
config: ['value', Util.getKarmaConfig(config)],
preprocess: ['factory', require('karma/lib/preprocessor').createPreprocessor],
fileList: ['type', require('karma/lib/file_list').List]
}]).invoke(discoverTests);
}
exports.run = run;
function discover(config, outputFile) {
var di = require('karma/node_modules/di');
var logger = require("karma/lib/logger");
var preprocessor = require('karma/lib/preprocessor');
var fileList = require('karma/lib/file_list').List;
var emitter = require('karma/lib/events').EventEmitter;
var karmaConfig = getKarmaConfig(config);
var modules = [{
logger: ['value', logger],
emitter: ['type', emitter],
config: ['value', karmaConfig],
preprocess: ['factory', preprocessor.createPreprocessor],
fileList: ['type', fileList]
}];
var discoverTests = function (fileList, logger, config) {
var log = Util.createLogger(logger);
try {
Util.baseDir = config.basePath;
var karma = new Test.Karma();
karma.add(new Test.KarmaConfig(karmaConfig));
fileList.refresh().then(function (files) {
try {
parseFiles(karma, files, log);
var xml = karma.toXml();
Util.writeFile(outputFile, karma.toXml());