This repository was archived by the owner on Jan 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,38 @@ var requireCliAndRun = function(karmaPath) {
18
18
if ( process . argv . indexOf ( '--which' ) !== - 1 ) {
19
19
console . log ( karmaPath ) ;
20
20
} else {
21
- require ( karmaPath + '/lib/cli' ) . run ( ) ;
21
+ var karmaCli = require ( karmaPath + '/lib/cli' ) ;
22
+
23
+ if ( karmaCli . run ) {
24
+ karmaCli . run ( ) ;
25
+ } else {
26
+ karmaCliRun ( karmaCli , karmaPath ) ;
27
+ }
28
+ }
29
+ } ;
30
+
31
+
32
+ // TODO(vojta): remove once we don't care about Karma 0.10
33
+ var karmaCliRun = function ( karmaCli , karmaPath ) {
34
+ var config = karmaCli . process ( ) ;
35
+
36
+ switch ( config . cmd ) {
37
+ case 'start' :
38
+ require ( karmaPath + '/lib/server' ) . start ( config ) ;
39
+ break ;
40
+ case 'run' :
41
+ require ( karmaPath + '/lib/runner' ) . run ( config ) ;
42
+ break ;
43
+ case 'init' :
44
+ require ( karmaPath + '/lib/init' ) . init ( config ) ;
45
+ break ;
46
+ case 'completion' :
47
+ require ( karmaPath + '/lib/completion' ) . completion ( config ) ;
48
+ break ;
22
49
}
23
50
} ;
24
51
52
+
25
53
resolve ( 'karma' , { basedir : process . cwd ( ) } , function ( err , pathToKarma ) {
26
54
// There is a local version, let's use it.
27
55
if ( ! err ) {
You can’t perform that action at this time.
0 commit comments