Files
Donny/강동윤andGitHub 76824e7556 fix(turbopack): Apply import_map option of swc_emotion correctly (#71776)
### What?

Preserve the `import_map` config specified by the user

### Why?

The default mode (webpack mode) supports the `import_map` config, so turbopack should also support it.

### How?

Closes https://github.com/vercel/next.js/issues/71408
2025-04-08 09:48:26 +02:00

41 lines
1008 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
import { check } from 'next-test-utils'
describe('app dir - emotion-js', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
dependencies: {
'@emotion/react': 'latest',
'@emotion/cache': 'latest',
},
})
if (skipped) {
return
}
it('should render emotion-js css with compiler.emotion option correctly', async () => {
const browser = await next.browser('/')
const el = browser.elementByCss('h1')
expect(await el.text()).toBe('Blue')
await check(
async () =>
await browser.eval(
`window.getComputedStyle(document.querySelector('h1')).color`
),
'rgb(0, 0, 255)'
)
const el2 = browser.elementByCss('p')
expect(await el2.text()).toBe('Red')
await check(
async () =>
await browser.eval(
`window.getComputedStyle(document.querySelector('p')).color`
),
'rgb(255, 0, 0)'
)
})
})