@@ -61,7 +61,7 @@ const runUpdateNotifier = async (t, {
61
61
if ( PACOTE_ERROR ) {
62
62
throw PACOTE_ERROR
63
63
}
64
- const manifestV = spec === 'npm@latest ' ? CURRENT_VERSION
64
+ const manifestV = spec === 'npm@* ' ? CURRENT_VERSION
65
65
: / - / . test ( spec ) ? CURRENT_BETA : NEXT_VERSION
66
66
return { version : manifestV }
67
67
} ,
@@ -127,7 +127,7 @@ t.test('situations in which we do not notify', t => {
127
127
const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t , {
128
128
command : 'install' ,
129
129
prefixDir : { 'package.json' : `{"name":"${ t . testName } "}` } ,
130
- argv : [ 'npm@latest ' ] ,
130
+ argv : [ 'npm@* ' ] ,
131
131
global : true ,
132
132
} )
133
133
t . equal ( wroteFile , false )
@@ -139,28 +139,28 @@ t.test('situations in which we do not notify', t => {
139
139
const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t )
140
140
t . equal ( wroteFile , true )
141
141
t . equal ( result , null )
142
- t . strictSame ( MANIFEST_REQUEST , [ 'npm@latest ' ] , 'requested latest version' )
142
+ t . strictSame ( MANIFEST_REQUEST , [ 'npm@* ' ] , 'requested latest version' )
143
143
} )
144
144
t . test ( 'check if stat errors (here for coverage)' , async t => {
145
145
const STAT_ERROR = new Error ( 'blorg' )
146
146
const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t , { STAT_ERROR } )
147
147
t . equal ( wroteFile , true )
148
148
t . equal ( result , null )
149
- t . strictSame ( MANIFEST_REQUEST , [ 'npm@latest ' ] , 'requested latest version' )
149
+ t . strictSame ( MANIFEST_REQUEST , [ 'npm@* ' ] , 'requested latest version' )
150
150
} )
151
151
t . test ( 'ok if write errors (here for coverage)' , async t => {
152
152
const WRITE_ERROR = new Error ( 'grolb' )
153
153
const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t , { WRITE_ERROR } )
154
154
t . equal ( wroteFile , true )
155
155
t . equal ( result , null )
156
- t . strictSame ( MANIFEST_REQUEST , [ 'npm@latest ' ] , 'requested latest version' )
156
+ t . strictSame ( MANIFEST_REQUEST , [ 'npm@* ' ] , 'requested latest version' )
157
157
} )
158
158
t . test ( 'ignore pacote failures (here for coverage)' , async t => {
159
159
const PACOTE_ERROR = new Error ( 'pah-KO-tchay' )
160
160
const { wroteFile, result, MANIFEST_REQUEST } = await runUpdateNotifier ( t , { PACOTE_ERROR } )
161
161
t . equal ( result , null )
162
162
t . equal ( wroteFile , true )
163
- t . strictSame ( MANIFEST_REQUEST , [ 'npm@latest ' ] , 'requested latest version' )
163
+ t . strictSame ( MANIFEST_REQUEST , [ 'npm@* ' ] , 'requested latest version' )
164
164
} )
165
165
t . test ( 'do not update if newer than latest, but same as next' , async t => {
166
166
const {
@@ -170,7 +170,7 @@ t.test('situations in which we do not notify', t => {
170
170
} = await runUpdateNotifier ( t , { version : NEXT_VERSION } )
171
171
t . equal ( result , null )
172
172
t . equal ( wroteFile , true )
173
- const reqs = [ 'npm@latest ' , `npm@^${ NEXT_VERSION } ` ]
173
+ const reqs = [ 'npm@* ' , `npm@^${ NEXT_VERSION } ` ]
174
174
t . strictSame ( MANIFEST_REQUEST , reqs , 'requested latest and next versions' )
175
175
} )
176
176
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 => {
222
222
t . test ( 'notification situations' , async t => {
223
223
const cases = {
224
224
[ 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 ] : [ '* ' ] ,
230
230
}
231
231
232
232
for ( const [ version , reqs ] of Object . entries ( cases ) ) {
0 commit comments