File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
test/integration/react-18 Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ const Foo = dynamic(() => import('./foo'), {
1010} )
1111
1212export default function Bar ( ) {
13+ if ( typeof window === 'undefined' ) {
14+ throw new Promise ( ( resolve ) => setTimeout ( resolve , 300 ) )
15+ }
1316 return (
1417 < div >
1518 bar
Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ export default (context, render) => {
4343 const $ = await get$ ( '/suspense/thrown' )
4444 const html = $ ( 'body' ) . html ( )
4545 expect ( html ) . toContain ( 'loading' )
46- expect ( JSON . parse ( $ ( '#__NEXT_DATA__' ) . html ( ) ) . dynamicIds ) . toContain (
47- './components/hello.js'
48- )
46+ expect (
47+ JSON . parse ( $ ( '#__NEXT_DATA__' ) . text ( ) ) . dynamicIds
48+ ) . toBeUndefined ( )
4949 } )
5050
5151 it ( 'should hydrate suspenses on client side' , async ( ) => {
@@ -86,7 +86,7 @@ export default (context, render) => {
8686 beforeAll ( ( ) => writeDynamicTestComponent ( { suspense : false , ssr : false } ) )
8787 afterAll ( ( ) => page . restore ( ) )
8888
89- it ( 'should render nothing on server side' , async ( ) => {
89+ it ( 'should render nothing on server side under Suspense ' , async ( ) => {
9090 const $ = await get$ ( '/suspense/thrown' )
9191 const text = $ ( '#__next' ) . text ( )
9292 expect ( text ) . toBe ( '' )
You can’t perform that action at this time.
0 commit comments