@@ -61,6 +61,8 @@ async function fingerprintApi() {
6161test ( 'auto update policy supports off notify and install modes' , async ( ) => {
6262 const api = await updateApi ( ) ;
6363
64+ assert . equal ( api . resolveAutoUpdateMode ( { } ) . mode , 'notify' ) ;
65+
6466 let checked = false ;
6567 await api . autoUpdate ( {
6668 env : { NIT_AUTO_UPDATE : 'off' } ,
@@ -101,6 +103,24 @@ test('auto update policy supports off notify and install modes', async () => {
101103 assert . match ( installStderr , / u p d a t i n g 0 \. 6 \. 1 5 - > 9 \. 9 \. 9 / ) ;
102104} ) ;
103105
106+ test ( 'auto update default notifies instead of installing' , async ( ) => {
107+ const api = await updateApi ( ) ;
108+
109+ const calls = [ ] ;
110+ let stderr = '' ;
111+ await api . autoUpdate ( {
112+ env : { } ,
113+ check : async ( ) => ( { current : '0.6.15' , latest : '9.9.9' } ) ,
114+ execFile : ( file , args , options ) => {
115+ calls . push ( { file, args, options } ) ;
116+ } ,
117+ stderr : { write : ( message ) => { stderr += message ; } } ,
118+ } ) ;
119+
120+ assert . equal ( calls . length , 0 ) ;
121+ assert . match ( stderr , / u p d a t e a v a i l a b l e 0 \. 6 \. 1 5 - > 9 \. 9 \. 9 / ) ;
122+ } ) ;
123+
104124test ( 'auto update keeps legacy opt out and rejects invalid policy' , async ( ) => {
105125 const api = await updateApi ( ) ;
106126
0 commit comments