next.js/test/development/basic/barrel-optimization/barrel-optimization-mui.test.ts
barrel-optimization-mui.test.ts35 lines1015 B
import { join } from 'path'
import { nextTestSetup } from 'e2e-utils'
import { waitForNoRedbox } from 'next-test-utils'

// This is implemented in Turbopack, but Turbopack doesn't log the module count.
;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)(
  'Skipped in Turbopack',
  () => {
    describe('optimizePackageImports - mui', () => {
      const { next } = nextTestSetup({
        env: {
          NEXT_TEST_MODE: '1',
        },
        files: join(__dirname, 'fixture'),

        dependencies: {
          '@mui/material': '5.15.15',
          '@emotion/react': '11.11.1',
          '@emotion/styled': '11.11.0',
        },
      })

      it('should support MUI', async () => {
        // Ensure that MUI is working
        const $ = await next.render$('/mui')
        expect($('#button').text()).toContain('button')
        expect($('#typography').text()).toContain('typography')

        const browser = await next.browser('/mui')
        await waitForNoRedbox(browser)
      })
    })
  }
)
Quest for Codev2.0.0
/
SIGN IN