| | import { nextTestSetup } from 'e2e-utils' |
| |
|
| | describe('experimental-lightningcss with default mode', () => { |
| | describe('in dev server', () => { |
| | const { isTurbopack, next } = nextTestSetup({ |
| | files: __dirname, |
| | dependencies: { lightningcss: '^1.23.0' }, |
| | packageJson: { |
| | browserslist: ['chrome 100'], |
| | }, |
| | }) |
| |
|
| | it('should support css modules', async () => { |
| | |
| | const $ = await next.render$('/') |
| | expect($('p').text()).toBe('hello world') |
| |
|
| | |
| | if (isTurbopack) { |
| | |
| | expect($('p').attr('class')).toBe( |
| | 'search-keyword style-module__hlQ3RG__blue' |
| | ) |
| | } else { |
| | |
| | expect($('p').attr('class')).toBe('search-keyword style-module__blue') |
| | } |
| | }) |
| |
|
| | it('should support browserslist', async () => { |
| | const $ = await next.browser('/') |
| |
|
| | expect(await $.elementByCss('.nested').text()).toBe('Red due to nesting') |
| | expect(await $.elementByCss('.nested').getComputedCss('color')).toBe( |
| | 'rgb(255, 0, 0)' |
| | ) |
| | }) |
| | }) |
| | }) |
| |
|