File size: 586 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { nextTestSetup } from 'e2e-utils'
;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)(
  'optimize-server-react',
  () => {
    const { next } = nextTestSetup({
      files: __dirname,
    })

    it('should work with useEffect', async () => {
      const browser = await next.browser('/')
      expect(await browser.elementByCss('p').text()).toBe('hello world')
    })

    it('should optimize useEffect call on server side', async () => {
      const file = await next.readFile('.next/server/pages/index.js')
      expect(file).not.toContain('useEffect')
    })
  }
)