@@ -80,9 +80,12 @@ const read = (options, cb) => {
80
80
81
81
const PATH = require ( '../../lib/utils/path.js' )
82
82
83
+ let CI_NAME = 'travis-ci'
84
+
83
85
const exec = requireInject ( '../../lib/exec.js' , {
84
86
'@npmcli/arborist' : Arborist ,
85
87
'@npmcli/run-script' : runScript ,
88
+ '@npmcli/ci-detect' : ( ) => CI_NAME ,
86
89
'../../lib/npm.js' : npm ,
87
90
pacote,
88
91
read,
@@ -531,9 +534,11 @@ t.test('prompt when installs are needed if not already present and shell is a TT
531
534
t . teardown ( ( ) => {
532
535
process . stdout . isTTY = stdoutTTY
533
536
process . stdin . isTTY = stdinTTY
537
+ CI_NAME = 'travis-ci'
534
538
} )
535
539
process . stdout . isTTY = true
536
540
process . stdin . isTTY = true
541
+ CI_NAME = false
537
542
538
543
const packages = [ 'foo' , 'bar' ]
539
544
READ_RESULT = 'yolo'
@@ -598,9 +603,11 @@ t.test('skip prompt when installs are needed if not already present and shell is
598
603
t . teardown ( ( ) => {
599
604
process . stdout . isTTY = stdoutTTY
600
605
process . stdin . isTTY = stdinTTY
606
+ CI_NAME = 'travis-ci'
601
607
} )
602
608
process . stdout . isTTY = false
603
609
process . stdin . isTTY = false
610
+ CI_NAME = false
604
611
605
612
const packages = [ 'foo' , 'bar' ]
606
613
READ_RESULT = 'yolo'
@@ -663,9 +670,11 @@ t.test('skip prompt when installs are needed if not already present and shell is
663
670
t . teardown ( ( ) => {
664
671
process . stdout . isTTY = stdoutTTY
665
672
process . stdin . isTTY = stdinTTY
673
+ CI_NAME = 'travis-ci'
666
674
} )
667
675
process . stdout . isTTY = false
668
676
process . stdin . isTTY = false
677
+ CI_NAME = false
669
678
670
679
const packages = [ 'foo' ]
671
680
READ_RESULT = 'yolo'
@@ -720,9 +729,11 @@ t.test('abort if prompt rejected', async t => {
720
729
t . teardown ( ( ) => {
721
730
process . stdout . isTTY = stdoutTTY
722
731
process . stdin . isTTY = stdinTTY
732
+ CI_NAME = 'travis-ci'
723
733
} )
724
734
process . stdout . isTTY = true
725
735
process . stdin . isTTY = true
736
+ CI_NAME = false
726
737
727
738
const packages = [ 'foo' , 'bar' ]
728
739
READ_RESULT = 'no, why would I want such a thing??'
@@ -776,9 +787,11 @@ t.test('abort if prompt false', async t => {
776
787
t . teardown ( ( ) => {
777
788
process . stdout . isTTY = stdoutTTY
778
789
process . stdin . isTTY = stdinTTY
790
+ CI_NAME = 'travis-ci'
779
791
} )
780
792
process . stdout . isTTY = true
781
793
process . stdin . isTTY = true
794
+ CI_NAME = false
782
795
783
796
const packages = [ 'foo' , 'bar' ]
784
797
READ_ERROR = 'canceled'
@@ -832,9 +845,11 @@ t.test('abort if -n provided', async t => {
832
845
t . teardown ( ( ) => {
833
846
process . stdout . isTTY = stdoutTTY
834
847
process . stdin . isTTY = stdinTTY
848
+ CI_NAME = 'travis-ci'
835
849
} )
836
850
process . stdout . isTTY = true
837
851
process . stdin . isTTY = true
852
+ CI_NAME = false
838
853
839
854
const packages = [ 'foo' , 'bar' ]
840
855
0 commit comments