next.js/test/development/project-directory-with-styled-jsx-suffix/index.test.ts
index.test.ts27 lines645 B
import { createNext } from 'e2e-utils'
import { NextInstance } from 'e2e-utils'
import { renderViaHTTP } from 'next-test-utils'

describe('project directory with styled-jsx suffix', () => {
  let next: NextInstance

  beforeAll(async () => {
    next = await createNext({
      files: {
        'pages/index.js': `
          export default function Page() { 
            return <p>hello world</p>
          } 
        `,
      },
      subDir: 'test-styled-jsx',
    })
  })
  afterAll(() => next.destroy())

  it('should work', async () => {
    const html = await renderViaHTTP(next.url, '/')
    expect(html).toContain('hello world')
  })
})
Quest for Codev2.0.0
/
SIGN IN