Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
feat: support Karma 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed Nov 18, 2013
1 parent 3df4297 commit 2d7729e
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion bin/karma
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,38 @@ var requireCliAndRun = function(karmaPath) {
if (process.argv.indexOf('--which') !== -1) {
console.log(karmaPath);
} else {
require(karmaPath + '/lib/cli').run();
var karmaCli = require(karmaPath + '/lib/cli');

if (karmaCli.run) {
karmaCli.run();
} else {
karmaCliRun(karmaCli, karmaPath);
}
}
};


// TODO(vojta): remove once we don't care about Karma 0.10
var karmaCliRun = function(karmaCli, karmaPath) {
var config = karmaCli.process();

switch (config.cmd) {
case 'start':
require(karmaPath + '/lib/server').start(config);
break;
case 'run':
require(karmaPath + '/lib/runner').run(config);
break;
case 'init':
require(karmaPath + '/lib/init').init(config);
break;
case 'completion':
require(karmaPath + '/lib/completion').completion(config);
break;
}
};


resolve('karma', {basedir: process.cwd()}, function(err, pathToKarma) {
// There is a local version, let's use it.
if (!err) {
Expand Down

0 comments on commit 2d7729e

Please sign in to comment.