File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,12 +78,12 @@ const getSPARenderer = lazyCachedFunction(async () => {
7878 buildAssetsURL
7979 }
8080 // Create SPA renderer and cache the result for all requests
81- const renderer = createRenderer ( ( ) => ( ) => { } , options )
81+ const renderer = createRenderer ( ( ) => ( ) => { } , options )
8282 const result = await renderer . renderToString ( { } )
8383
8484 const renderToString = ( ssrContext : NuxtSSRContext ) => {
8585 const config = useRuntimeConfig ( )
86- ssrContext . payload = {
86+ ssrContext . nuxt = {
8787 serverRendered : false ,
8888 config : {
8989 public : config . public ,
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ await setup({
1010
1111describe ( 'pages' , ( ) => {
1212 it ( 'render hello world' , async ( ) => {
13- expect ( await $fetch ( '/' ) ) . to . contain ( 'Hello Vue 2!' )
13+ const html = await $fetch ( '/' )
14+ expect ( html ) . toContain ( 'Hello Vue 2!' )
15+ expect ( html ) . toContain ( 'public:{myValue:123}' )
1416 await expectNoClientErrors ( '/' )
1517 } )
1618 it ( 'uses server Vue build' , async ( ) => {
17- expect ( await $fetch ( '/' ) ) . to . contain ( 'Rendered on server: true' )
19+ expect ( await $fetch ( '/' ) ) . toContain ( 'Rendered on server: true' )
1820 } )
1921} )
2022
You can’t perform that action at this time.
0 commit comments