-
Notifications
You must be signed in to change notification settings - Fork 26.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test/development/app-dir/experimental-lightningcss/experimenta…
…l-lightningcss.test.ts Co-authored-by: Leah <github.leah@hrmny.sh>
- Loading branch information
1 parent
6d982ac
commit bb486d2
Showing
1 changed file
with
13 additions
and
19 deletions.
There are no files selected for viewing
32 changes: 13 additions & 19 deletions
32
test/development/app-dir/experimental-lightningcss/experimental-lightningcss.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
import { createNextDescribe } from 'e2e-utils' | ||
import { nextTestSetup } from 'e2e-utils' | ||
import { describeVariants as describe } from 'next-test-utils' | ||
|
||
createNextDescribe( | ||
'experimental-lightningcss', | ||
{ | ||
describe.each(['turbo'])('experimental-lightningcss', () => { | ||
const { next } = nextTestSetup({ | ||
files: __dirname, | ||
}, | ||
({ next }) => { | ||
}) | ||
|
||
it('should support css modules', async () => { | ||
// Recommended for tests that check HTML. Cheerio is a HTML parser that has a jQuery like API. | ||
;(process.env.TURBOPACK ? describe : describe.skip)( | ||
'with it enabled', | ||
() => { | ||
it('should support css modules', async () => { | ||
const $ = await next.render$('/') | ||
expect($('p').text()).toBe('hello world') | ||
// swc_css does not include `-module` in the class name, while lightningcss does. | ||
expect($('p').attr('class')).toBe('style-module__hlQ3RG__blue') | ||
}) | ||
} | ||
) | ||
} | ||
) | ||
const $ = await next.render$('/') | ||
expect($('p').text()).toBe('hello world') | ||
// swc_css does not include `-module` in the class name, while lightningcss does. | ||
expect($('p').attr('class')).toBe('style-module__hlQ3RG__blue') | ||
}) | ||
}) |