@@ -191,21 +191,21 @@ describe("fetchRelease", () => {
191191 expect ( result ) . toEqual ( release ) ;
192192 } ) ;
193193
194- it ( "default path: resolves via npm alpha dist-tag then fetches that GitHub tag" , async ( ) => {
194+ it ( "default path: resolves via npm latest dist-tag then fetches that GitHub tag" , async ( ) => {
195195 const release = {
196- tag_name : "v0.1.17-alpha.0 " ,
196+ tag_name : "v0.1.17" ,
197197 assets : [
198198 {
199199 name : "vp-setup-x86_64-pc-windows-msvc.exe" ,
200200 browser_download_url :
201- "https://github.com/voidzero-dev/vite-plus/releases/download/v0.1.17-alpha.0 /vp-setup-x86_64-pc-windows-msvc.exe" ,
201+ "https://github.com/voidzero-dev/vite-plus/releases/download/v0.1.17/vp-setup-x86_64-pc-windows-msvc.exe" ,
202202 } ,
203203 ] ,
204204 } ;
205205 const fetchMock = vi
206206 . fn ( )
207207 . mockResolvedValueOnce (
208- new Response ( JSON . stringify ( { "dist-tags" : { alpha : "0.1.17-alpha.0 " } } ) , { status : 200 } ) ,
208+ new Response ( JSON . stringify ( { "dist-tags" : { latest : "0.1.17" } } ) , { status : 200 } ) ,
209209 )
210210 . mockResolvedValueOnce ( new Response ( JSON . stringify ( release ) , { status : 200 } ) ) ;
211211 vi . stubGlobal ( "fetch" , fetchMock ) ;
@@ -215,7 +215,7 @@ describe("fetchRelease", () => {
215215 expect ( result ) . toEqual ( release ) ;
216216 expect ( fetchMock ) . toHaveBeenCalledTimes ( 2 ) ;
217217 const secondCallUrl = fetchMock . mock . calls [ 1 ] [ 0 ] ;
218- expect ( secondCallUrl ) . toContain ( "/releases/tags/v0.1.17-alpha.0 " ) ;
218+ expect ( secondCallUrl ) . toContain ( "/releases/tags/v0.1.17" ) ;
219219 } ) ;
220220
221221 it ( "default path: returns null and skips GitHub when npm registry fails" , async ( ) => {
@@ -232,11 +232,11 @@ describe("fetchRelease", () => {
232232 expect ( fetchMock ) . toHaveBeenCalledTimes ( 1 ) ;
233233 } ) ;
234234
235- it ( "default path: returns null and skips GitHub when npm has no alpha dist-tag" , async ( ) => {
235+ it ( "default path: returns null and skips GitHub when npm has no latest dist-tag" , async ( ) => {
236236 const fetchMock = vi
237237 . fn ( )
238238 . mockResolvedValueOnce (
239- new Response ( JSON . stringify ( { "dist-tags" : { latest : "0.1.0 " } } ) , { status : 200 } ) ,
239+ new Response ( JSON . stringify ( { "dist-tags" : { alpha : "0.1.17-alpha.5 " } } ) , { status : 200 } ) ,
240240 ) ;
241241 vi . stubGlobal ( "fetch" , fetchMock ) ;
242242
@@ -250,7 +250,7 @@ describe("fetchRelease", () => {
250250 const fetchMock = vi
251251 . fn ( )
252252 . mockResolvedValueOnce (
253- new Response ( JSON . stringify ( { "dist-tags" : { alpha : "0.1.17-alpha.0 " } } ) , { status : 200 } ) ,
253+ new Response ( JSON . stringify ( { "dist-tags" : { latest : "0.1.17" } } ) , { status : 200 } ) ,
254254 )
255255 . mockResolvedValueOnce ( new Response ( "Not Found" , { status : 404 , statusText : "Not Found" } ) ) ;
256256 vi . stubGlobal ( "fetch" , fetchMock ) ;
0 commit comments