File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,9 +119,6 @@ Cli.run = function run(processArgv) {
119119 } ) ;
120120 }
121121
122- // Gather stats on the current command execution
123- IonicStats . t ( ) ;
124-
125122 var taskName = argv . _ [ 0 ] ;
126123 var task = Cli . getTaskSettingsByName ( taskName ) ;
127124 log . debug ( 'Task:' , task ) ;
@@ -134,6 +131,9 @@ Cli.run = function run(processArgv) {
134131
135132 var booleanOptions = Cli . getListOfBooleanOptions ( task . options ) ;
136133
134+ // Gather stats on the current command execution
135+ IonicStats . t ( ) ;
136+
137137 // Remove all possible task boolean options from the args
138138 argv = optimist ( rawCliArguments )
139139 . boolean ( booleanOptions )
Original file line number Diff line number Diff line change @@ -162,6 +162,15 @@ describe('Cli', function() {
162162 } ) ;
163163 } ) ;
164164
165+ it ( 'should not track stats for cli for a bogus command' , function ( done ) {
166+
167+ IonicCli . run ( [ 'node' , 'bin/ionic' , 'helper' ] )
168+ . then ( function ( ) {
169+ expect ( IonicStats . t ) . not . toHaveBeenCalled ( ) ;
170+ done ( ) ;
171+ } ) ;
172+ } ) ;
173+
165174 it ( 'should change cwd to project root for project tasks' , function ( done ) {
166175 var processArguments = [ 'node' , 'bin/ionic' , 'fake' ] ;
167176 var rawCliArguments = processArguments . slice ( 2 ) ;
You can’t perform that action at this time.
0 commit comments