@@ -80,9 +80,12 @@ const read = (options, cb) => {
8080
8181const PATH = require ( '../../lib/utils/path.js' )
8282
83+ let CI_NAME = 'travis-ci'
84+
8385const exec = requireInject ( '../../lib/exec.js' , {
8486 '@npmcli/arborist' : Arborist ,
8587 '@npmcli/run-script' : runScript ,
88+ '@npmcli/ci-detect' : ( ) => CI_NAME ,
8689 '../../lib/npm.js' : npm ,
8790 pacote,
8891 read,
@@ -531,9 +534,11 @@ t.test('prompt when installs are needed if not already present and shell is a TT
531534 t . teardown ( ( ) => {
532535 process . stdout . isTTY = stdoutTTY
533536 process . stdin . isTTY = stdinTTY
537+ CI_NAME = 'travis-ci'
534538 } )
535539 process . stdout . isTTY = true
536540 process . stdin . isTTY = true
541+ CI_NAME = false
537542
538543 const packages = [ 'foo' , 'bar' ]
539544 READ_RESULT = 'yolo'
@@ -598,9 +603,11 @@ t.test('skip prompt when installs are needed if not already present and shell is
598603 t . teardown ( ( ) => {
599604 process . stdout . isTTY = stdoutTTY
600605 process . stdin . isTTY = stdinTTY
606+ CI_NAME = 'travis-ci'
601607 } )
602608 process . stdout . isTTY = false
603609 process . stdin . isTTY = false
610+ CI_NAME = false
604611
605612 const packages = [ 'foo' , 'bar' ]
606613 READ_RESULT = 'yolo'
@@ -663,9 +670,11 @@ t.test('skip prompt when installs are needed if not already present and shell is
663670 t . teardown ( ( ) => {
664671 process . stdout . isTTY = stdoutTTY
665672 process . stdin . isTTY = stdinTTY
673+ CI_NAME = 'travis-ci'
666674 } )
667675 process . stdout . isTTY = false
668676 process . stdin . isTTY = false
677+ CI_NAME = false
669678
670679 const packages = [ 'foo' ]
671680 READ_RESULT = 'yolo'
@@ -720,9 +729,11 @@ t.test('abort if prompt rejected', async t => {
720729 t . teardown ( ( ) => {
721730 process . stdout . isTTY = stdoutTTY
722731 process . stdin . isTTY = stdinTTY
732+ CI_NAME = 'travis-ci'
723733 } )
724734 process . stdout . isTTY = true
725735 process . stdin . isTTY = true
736+ CI_NAME = false
726737
727738 const packages = [ 'foo' , 'bar' ]
728739 READ_RESULT = 'no, why would I want such a thing??'
@@ -776,9 +787,11 @@ t.test('abort if prompt false', async t => {
776787 t . teardown ( ( ) => {
777788 process . stdout . isTTY = stdoutTTY
778789 process . stdin . isTTY = stdinTTY
790+ CI_NAME = 'travis-ci'
779791 } )
780792 process . stdout . isTTY = true
781793 process . stdin . isTTY = true
794+ CI_NAME = false
782795
783796 const packages = [ 'foo' , 'bar' ]
784797 READ_ERROR = 'canceled'
@@ -832,9 +845,11 @@ t.test('abort if -n provided', async t => {
832845 t . teardown ( ( ) => {
833846 process . stdout . isTTY = stdoutTTY
834847 process . stdin . isTTY = stdinTTY
848+ CI_NAME = 'travis-ci'
835849 } )
836850 process . stdout . isTTY = true
837851 process . stdin . isTTY = true
852+ CI_NAME = false
838853
839854 const packages = [ 'foo' , 'bar' ]
840855
0 commit comments