@@ -178,6 +178,50 @@ describe('start command', function() {
178178 } ) ;
179179 } ) ;
180180
181+ it ( 'should use javascript if starting a v2 project with --v2 and --no-ts' , function ( done ) {
182+ var processArguments = [ 'node' , 'ionic' , 'start' , 'newDir' , '--v2' , '--no-ts' ] ;
183+ var rawCliArguments = processArguments . slice ( 2 ) ;
184+ var argv = optimist ( rawCliArguments ) . argv ;
185+
186+ spyOn ( fs , 'existsSync' ) . andReturn ( false ) ;
187+ spyOn ( appLibUtils , 'preprocessCliOptions' ) . andCallThrough ( ) ;
188+ spyOn ( Start , 'promptForOverwrite' ) ;
189+ spyOn ( Start , 'startApp' ) . andReturn ( Q ( true ) ) ;
190+ spyOn ( Start , 'printQuickHelp' ) . andReturn ( Q ( true ) ) ;
191+ spyOn ( Start , 'promptLogin' ) . andReturn ( Q ( true ) ) ;
192+
193+ start . run ( { } , argv ) . then ( function ( ) {
194+ expect ( appLibUtils . preprocessCliOptions . calls [ 0 ] . args [ 0 ] . v2 ) . toEqual ( true ) ;
195+ expect ( appLibUtils . preprocessCliOptions . calls [ 0 ] . args [ 0 ] . ts ) . toEqual ( false ) ;
196+ expect ( log . info ) . toHaveBeenCalledWith (
197+ '\nNew to Ionic? Get started here: http://ionicframework.com/docs/v2/getting-started\n'
198+ ) ;
199+ done ( ) ;
200+ } ) ;
201+ } ) ;
202+
203+ it ( 'should use javascript if starting a v2 project with --v2 and --no-typescript' , function ( done ) {
204+ var processArguments = [ 'node' , 'ionic' , 'start' , 'newDir' , '--v2' , '--no-typescript' ] ;
205+ var rawCliArguments = processArguments . slice ( 2 ) ;
206+ var argv = optimist ( rawCliArguments ) . argv ;
207+
208+ spyOn ( fs , 'existsSync' ) . andReturn ( false ) ;
209+ spyOn ( appLibUtils , 'preprocessCliOptions' ) . andCallThrough ( ) ;
210+ spyOn ( Start , 'promptForOverwrite' ) ;
211+ spyOn ( Start , 'startApp' ) . andReturn ( Q ( true ) ) ;
212+ spyOn ( Start , 'printQuickHelp' ) . andReturn ( Q ( true ) ) ;
213+ spyOn ( Start , 'promptLogin' ) . andReturn ( Q ( true ) ) ;
214+
215+ start . run ( { } , argv ) . then ( function ( ) {
216+ expect ( appLibUtils . preprocessCliOptions . calls [ 0 ] . args [ 0 ] . v2 ) . toEqual ( true ) ;
217+ expect ( appLibUtils . preprocessCliOptions . calls [ 0 ] . args [ 0 ] . typescript ) . toEqual ( false ) ;
218+ expect ( log . info ) . toHaveBeenCalledWith (
219+ '\nNew to Ionic? Get started here: http://ionicframework.com/docs/v2/getting-started\n'
220+ ) ;
221+ done ( ) ;
222+ } ) ;
223+ } ) ;
224+
181225 it ( 'should catch error if any process throws' , function ( done ) {
182226 var processArguments = [ 'node' , 'ionic' , 'start' , 'newDir' ] ;
183227 var rawCliArguments = processArguments . slice ( 2 ) ;
0 commit comments