@@ -61,7 +61,7 @@ const runUpdateNotifier = async (t, {
6161 if ( PACOTE_ERROR ) {
6262 throw PACOTE_ERROR
6363 }
64- const manifestV = spec === 'npm@latest ' ? CURRENT_VERSION
64+ const manifestV = spec === 'npm@* ' ? CURRENT_VERSION
6565 : / - / . test ( spec ) ? CURRENT_BETA : NEXT_VERSION
6666 return { version : manifestV }
6767 } ,
@@ -127,7 +127,7 @@ t.test('situations in which we do not notify', t => {
127127 const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t , {
128128 command : 'install' ,
129129 prefixDir : { 'package.json' : `{"name":"${ t . testName } "}` } ,
130- argv : [ 'npm@latest ' ] ,
130+ argv : [ 'npm@* ' ] ,
131131 global : true ,
132132 } )
133133 t . equal ( wroteFile , false )
@@ -139,28 +139,28 @@ t.test('situations in which we do not notify', t => {
139139 const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t )
140140 t . equal ( wroteFile , true )
141141 t . equal ( result , null )
142- t . strictSame ( MANIFEST_REQUEST , [ 'npm@latest ' ] , 'requested latest version' )
142+ t . strictSame ( MANIFEST_REQUEST , [ 'npm@* ' ] , 'requested latest version' )
143143 } )
144144 t . test ( 'check if stat errors (here for coverage)' , async t => {
145145 const STAT_ERROR = new Error ( 'blorg' )
146146 const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t , { STAT_ERROR } )
147147 t . equal ( wroteFile , true )
148148 t . equal ( result , null )
149- t . strictSame ( MANIFEST_REQUEST , [ 'npm@latest ' ] , 'requested latest version' )
149+ t . strictSame ( MANIFEST_REQUEST , [ 'npm@* ' ] , 'requested latest version' )
150150 } )
151151 t . test ( 'ok if write errors (here for coverage)' , async t => {
152152 const WRITE_ERROR = new Error ( 'grolb' )
153153 const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t , { WRITE_ERROR } )
154154 t . equal ( wroteFile , true )
155155 t . equal ( result , null )
156- t . strictSame ( MANIFEST_REQUEST , [ 'npm@latest ' ] , 'requested latest version' )
156+ t . strictSame ( MANIFEST_REQUEST , [ 'npm@* ' ] , 'requested latest version' )
157157 } )
158158 t . test ( 'ignore pacote failures (here for coverage)' , async t => {
159159 const PACOTE_ERROR = new Error ( 'pah-KO-tchay' )
160160 const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t , { PACOTE_ERROR } )
161161 t . equal ( result , null )
162162 t . equal ( wroteFile , true )
163- t . strictSame ( MANIFEST_REQUEST , [ 'npm@latest ' ] , 'requested latest version' )
163+ t . strictSame ( MANIFEST_REQUEST , [ 'npm@* ' ] , 'requested latest version' )
164164 } )
165165 t . test ( 'do not update if newer than latest, but same as next' , async t => {
166166 const {
@@ -170,7 +170,7 @@ t.test('situations in which we do not notify', t => {
170170 } = await runUpdateNotifier ( t , { version : NEXT_VERSION } )
171171 t . equal ( result , null )
172172 t . equal ( wroteFile , true )
173- const reqs = [ 'npm@latest ' , `npm@^${ NEXT_VERSION } ` ]
173+ const reqs = [ 'npm@* ' , `npm@^${ NEXT_VERSION } ` ]
174174 t . strictSame ( MANIFEST_REQUEST , reqs , 'requested latest and next versions' )
175175 } )
176176 t . test ( 'do not update if on the latest beta' , async t => {
@@ -222,11 +222,11 @@ t.test('situations in which we do not notify', t => {
222222t . test ( 'notification situations' , async t => {
223223 const cases = {
224224 [ HAVE_BETA ] : [ `^{V}` ] ,
225- [ NEXT_PATCH ] : [ `latest ` , `^{V}` ] ,
226- [ NEXT_MINOR ] : [ `latest ` , `^{V}` ] ,
227- [ CURRENT_PATCH ] : [ 'latest ' ] ,
228- [ CURRENT_MINOR ] : [ 'latest ' ] ,
229- [ CURRENT_MAJOR ] : [ 'latest ' ] ,
225+ [ NEXT_PATCH ] : [ `* ` , `^{V}` ] ,
226+ [ NEXT_MINOR ] : [ `* ` , `^{V}` ] ,
227+ [ CURRENT_PATCH ] : [ '* ' ] ,
228+ [ CURRENT_MINOR ] : [ '* ' ] ,
229+ [ CURRENT_MAJOR ] : [ '* ' ] ,
230230 }
231231
232232 for ( const [ version , reqs ] of Object . entries ( cases ) ) {
0 commit comments