@@ -312,10 +312,12 @@ describe('Unit: Command', function () {
312
312
const setEnvironmentStub = sinon . stub ( ) ;
313
313
const loadOsInfo = sinon . stub ( ) . resolves ( ) ;
314
314
const systemStub = sinon . stub ( ) . returns ( { setEnvironment : setEnvironmentStub , loadOsInfo} ) ;
315
+ const deprecationChecks = sinon . stub ( ) . resolves ( ) ;
315
316
316
317
const Command = proxyquire ( modulePath , {
317
318
'./ui' : uiStub ,
318
- './system' : systemStub
319
+ './system' : systemStub ,
320
+ './utils/deprecation-checks' : deprecationChecks
319
321
} ) ;
320
322
321
323
class TestCommand extends Command { }
@@ -339,8 +341,9 @@ describe('Unit: Command', function () {
339
341
expect ( setEnvironmentStub . calledWithExactly ( true , true ) ) . to . be . true ;
340
342
expect ( systemStub . calledOnce ) . to . be . true ;
341
343
expect ( systemStub . calledWithExactly ( { ui : true , run} , [ { extensiona : true } ] ) ) . to . be . true ;
342
- expect ( run . calledOnce ) . to . be . true ;
344
+ expect ( run . calledTwice ) . to . be . true ;
343
345
expect ( loadOsInfo . calledOnce ) . to . be . true ;
346
+ expect ( deprecationChecks . calledOnce ) . to . be . true ;
344
347
expect ( runStub . calledOnce ) . to . be . true ;
345
348
expect ( runStub . calledWithExactly ( { verbose : true , prompt : true , development : true , auto : false } ) ) . to . be . true ;
346
349
} ) ;
@@ -351,16 +354,19 @@ describe('Unit: Command', function () {
351
354
const setEnvironmentStub = sinon . stub ( ) ;
352
355
const loadOsInfo = sinon . stub ( ) . resolves ( ) ;
353
356
const systemStub = sinon . stub ( ) . returns ( { setEnvironment : setEnvironmentStub , loadOsInfo} ) ;
357
+ const deprecationChecks = sinon . stub ( ) . resolves ( ) ;
354
358
355
359
const Command = proxyquire ( modulePath , {
356
360
'./ui' : uiStub ,
357
- './system' : systemStub
361
+ './system' : systemStub ,
362
+ './utils/deprecation-checks' : deprecationChecks
358
363
} ) ;
359
364
360
365
class TestCommand extends Command {
361
366
cleanup ( ) { }
362
367
}
363
368
TestCommand . global = true ;
369
+ TestCommand . skipDeprecationCheck = true ;
364
370
365
371
const runStub = sinon . stub ( TestCommand . prototype , 'run' ) ;
366
372
const onStub = sinon . stub ( process , 'on' ) . returnsThis ( ) ;
@@ -384,6 +390,7 @@ describe('Unit: Command', function () {
384
390
expect ( systemStub . calledWithExactly ( { ui : true , run} , [ { extensiona : true } ] ) ) . to . be . true ;
385
391
expect ( run . calledOnce ) . to . be . true ;
386
392
expect ( loadOsInfo . calledOnce ) . to . be . true ;
393
+ expect ( deprecationChecks . called ) . to . be . false ;
387
394
expect ( runStub . calledOnce ) . to . be . true ;
388
395
expect ( runStub . calledWithExactly ( { verbose : false , prompt : false , development : false , auto : true } ) ) . to . be . true ;
389
396
expect ( onStub . calledThrice ) . to . be . true ;
@@ -398,12 +405,14 @@ describe('Unit: Command', function () {
398
405
const setEnvironmentStub = sinon . stub ( ) ;
399
406
const loadOsInfo = sinon . stub ( ) . resolves ( ) ;
400
407
const systemStub = sinon . stub ( ) . returns ( { setEnvironment : setEnvironmentStub , loadOsInfo} ) ;
408
+ const deprecationChecks = sinon . stub ( ) . resolves ( ) ;
401
409
const preChecksStub = sinon . stub ( ) . resolves ( ) ;
402
410
403
411
const Command = proxyquire ( modulePath , {
404
412
'./ui' : uiStub ,
405
413
'./system' : systemStub ,
406
- './utils/pre-checks' : preChecksStub
414
+ './utils/pre-checks' : preChecksStub ,
415
+ './utils/deprecation-checks' : deprecationChecks
407
416
} ) ;
408
417
409
418
class TestCommand extends Command { }
@@ -429,8 +438,9 @@ describe('Unit: Command', function () {
429
438
expect ( setEnvironmentStub . calledWithExactly ( true , true ) ) . to . be . true ;
430
439
expect ( systemStub . calledOnce ) . to . be . true ;
431
440
expect ( systemStub . calledWithExactly ( { ui : true , run} , [ { extensiona : true } ] ) ) . to . be . true ;
432
- expect ( run . calledOnce ) . to . be . true ;
441
+ expect ( run . calledTwice ) . to . be . true ;
433
442
expect ( loadOsInfo . calledOnce ) . to . be . true ;
443
+ expect ( deprecationChecks . calledOnce ) . to . be . true ;
434
444
expect ( preChecksStub . calledOnce ) . to . be . true ;
435
445
expect ( preChecksStub . calledWithExactly ( { ui : true , run} , { setEnvironment : setEnvironmentStub , loadOsInfo} ) ) . to . be . true ;
436
446
expect ( runStub . calledOnce ) . to . be . true ;
@@ -444,10 +454,12 @@ describe('Unit: Command', function () {
444
454
const loadOsInfo = sinon . stub ( ) . resolves ( ) ;
445
455
const setEnvironmentStub = sinon . stub ( ) ;
446
456
const systemStub = sinon . stub ( ) . returns ( { setEnvironment : setEnvironmentStub , loadOsInfo} ) ;
457
+ const deprecationChecks = sinon . stub ( ) . resolves ( ) ;
447
458
448
459
const Command = proxyquire ( modulePath , {
449
460
'./ui' : uiStub ,
450
- './system' : systemStub
461
+ './system' : systemStub ,
462
+ './utils/deprecation-checks' : deprecationChecks
451
463
} ) ;
452
464
453
465
class TestCommand extends Command {
@@ -477,8 +489,9 @@ describe('Unit: Command', function () {
477
489
expect ( setEnvironmentStub . calledWithExactly ( false , true ) ) . to . be . true ;
478
490
expect ( systemStub . calledOnce ) . to . be . true ;
479
491
expect ( systemStub . calledWithExactly ( { error : errorStub , run} , [ { extensiona : true } ] ) ) . to . be . true ;
480
- expect ( run . calledOnce ) . to . be . true ;
492
+ expect ( run . calledTwice ) . to . be . true ;
481
493
expect ( loadOsInfo . calledOnce ) . to . be . true ;
494
+ expect ( deprecationChecks . calledOnce ) . to . be . true ;
482
495
expect ( runStub . calledOnce ) . to . be . true ;
483
496
expect ( runStub . calledWithExactly ( { verbose : false , prompt : false , development : false , auto : false } ) ) . to . be . true ;
484
497
expect ( errorStub . calledOnce ) . to . be . true ;
0 commit comments