next.js/test/e2e/rsc-layers-transform/rsc-layers-transform.test.ts
rsc-layers-transform.test.ts25 lines690 B
import { nextTestSetup } from 'e2e-utils'

describe('rsc layers transform', () => {
  const { next, isNextDeploy } = nextTestSetup({
    files: __dirname,
  })

  it('should render installed react-server condition for middleware', async () => {
    const json = await next.fetch('/middleware').then((res) => res.json())

    expect(json).toEqual({
      textValue: 'text-value',
      linkType: 'function',
    })
  })

  if (!isNextDeploy) {
    it('should call instrumentation hook without errors', async () => {
      const output = next.cliOutput
      expect(output).toContain('instrumentation:register')
      expect(output).toContain('instrumentation:text:text-value')
    })
  }
})
Quest for Codev2.0.0
/
SIGN IN