@@ -392,3 +392,50 @@ Deno.test({
392392 sanitizeOps : false ,
393393 sanitizeResources : false ,
394394} ) ;
395+
396+ Deno . test ( {
397+ name : "vite dev - client side <Head>" ,
398+ fn : async ( ) => {
399+ await launchDevServer ( DEMO_DIR , async ( address ) => {
400+ await withBrowser ( async ( page ) => {
401+ await page . goto ( `${ address } /tests/head_counter` , {
402+ waitUntil : "networkidle2" ,
403+ } ) ;
404+
405+ await page . locator ( ".ready" ) . wait ( ) ;
406+ await page . locator ( "button" ) . click ( ) ;
407+ await waitForText ( page , ".result" , "Count: 1" ) ;
408+
409+ await waitFor ( async ( ) => {
410+ const title = await page . evaluate ( ( ) => document . title ) ;
411+ expect ( title ) . toEqual ( "Count: 1" ) ;
412+ return true ;
413+ } ) ;
414+
415+ await page . goto ( `${ address } /tests/head_meta` , {
416+ waitUntil : "networkidle2" ,
417+ } ) ;
418+
419+ await page . locator ( ".ready" ) . wait ( ) ;
420+
421+ // await new Promise((r) => setTimeout(r, 200000));
422+ await waitFor ( async ( ) => {
423+ const custom = await page
424+ . locator ( "meta[name='custom']" )
425+ // deno-lint-ignore no-explicit-any
426+ . evaluate ( ( el : any ) => el . content ) ;
427+ expect ( custom ) . toEqual ( "ok" ) ;
428+
429+ const custom2 = await page
430+ . locator ( "meta[name='custom-new']" )
431+ // deno-lint-ignore no-explicit-any
432+ . evaluate ( ( el : any ) => el . content ) ;
433+ expect ( custom2 ) . toEqual ( "ok" ) ;
434+ return true ;
435+ } ) ;
436+ } ) ;
437+ } ) ;
438+ } ,
439+ sanitizeOps : false ,
440+ sanitizeResources : false ,
441+ } ) ;
0 commit comments