@@ -56,7 +56,7 @@ describe('added .env to gitignore with --compare and --fix', () => {
5656 fs . mkdirSync ( path . join ( cwd , 'src' ) , { recursive : true } ) ;
5757 fs . writeFileSync (
5858 path . join ( cwd , 'src' , 'index.ts' ) ,
59- ` const apiKey = process.env.API_KEY;` . trimStart ( ) ,
59+ ' const apiKey = process.env.API_KEY;' . trimStart ( ) ,
6060 ) ;
6161
6262 const res = runCli ( cwd , [ '--compare' , '--fix' ] ) ;
@@ -78,7 +78,7 @@ describe('added .env to gitignore with --compare and --fix', () => {
7878 fs . mkdirSync ( path . join ( cwd , 'src' ) , { recursive : true } ) ;
7979 fs . writeFileSync (
8080 path . join ( cwd , 'src' , 'index.ts' ) ,
81- ` const apiKey = process.env.API_KEY;` . trimStart ( ) ,
81+ ' const apiKey = process.env.API_KEY;' . trimStart ( ) ,
8282 ) ;
8383
8484 const res = runCli ( cwd , [ '--compare' , '--json' ] ) ;
@@ -89,17 +89,15 @@ describe('added .env to gitignore with --compare and --fix', () => {
8989 expect ( json [ 0 ] . gitignoreIssue ?. reason ) . toBe ( 'not-ignored' ) ;
9090 } ) ;
9191
92- it ( 'Will prompt .env.example file not found. and prompt if .env.local exists and .env.example is set to --example' , async ( ) => {
92+ it ( 'Will skip interactive prompt in non-TTY when .env.example is missing and --example is set ' , async ( ) => {
9393 const cwd = tmpDir ( ) ;
9494 fs . writeFileSync ( path . join ( cwd , '.env.local' ) , 'FOO=bar' ) ;
9595
9696 const res = runCli ( cwd , [ '--compare' , '--example' , '.env.example' ] ) ;
9797
9898 expect ( res . status ) . toBe ( 0 ) ;
9999 expect ( res . stdout ) . toContain ( '▸ File not found' ) ;
100- expect ( res . stdout ) . toContain (
101- 'Do you want to create a .env.example file from .env.local?' ,
102- ) ;
100+ expect ( res . stdout ) . toContain ( '▸ Skipping .env.example creation' ) ;
103101 } ) ;
104102
105103 describe ( 'Values mismatch checks' , ( ) => {
0 commit comments