-
Notifications
You must be signed in to change notification settings - Fork 27.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test] Remove describeVariants
helper
#76631
Merged
eps1lon
merged 1 commit into
canary
from
sebbie/02-27-_test_remove_describevariants_helper
Mar 3, 2025
+32
−68
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
74 changes: 30 additions & 44 deletions
74
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,53 +1,39 @@ | ||
import { nextTestSetup } from 'e2e-utils' | ||
import { describeVariants } from 'next-test-utils' | ||
|
||
describeVariants.each(['turbo'])('experimental-lightningcss', () => { | ||
const { next } = nextTestSetup({ | ||
files: __dirname, | ||
}) | ||
|
||
it('should support css modules', async () => { | ||
// Recommended for tests that check HTML. Cheerio is a HTML parser that has a jQuery like API. | ||
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( | ||
'search-keyword style-module__hlQ3RG__blue' | ||
) | ||
}) | ||
}) | ||
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'], | ||
}, | ||
}) | ||
|
||
// lightningcss produces different class names in turbo mode | ||
describeVariants.each(['default'])( | ||
'experimental-lightningcss with default mode', | ||
() => { | ||
describe('in dev server', () => { | ||
const { next } = nextTestSetup({ | ||
files: __dirname, | ||
dependencies: { lightningcss: '^1.23.0' }, | ||
packageJson: { | ||
browserslist: ['chrome 100'], | ||
}, | ||
}) | ||
it('should support css modules', async () => { | ||
// Recommended for tests that check HTML. Cheerio is a HTML parser that has a jQuery like API. | ||
const $ = await next.render$('/') | ||
expect($('p').text()).toBe('hello world') | ||
|
||
it('should support css modules', async () => { | ||
// Recommended for tests that check HTML. Cheerio is a HTML parser that has a jQuery like API. | ||
const $ = await next.render$('/') | ||
expect($('p').text()).toBe('hello world') | ||
// lightningcss produces different class names in turbo mode | ||
if (isTurbopack) { | ||
// swc_css does not include `-module` in the class name, while lightningcss does. | ||
expect($('p').attr('class')).toBe( | ||
'search-keyword style-module__hlQ3RG__blue' | ||
) | ||
} else { | ||
// We remove hash from the class name in test mode using env var because it is not deterministic. | ||
expect($('p').attr('class')).toBe('search-keyword style-module__blue') | ||
}) | ||
} | ||
}) | ||
|
||
it('should support browserslist', async () => { | ||
const $ = await next.browser('/') | ||
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)' | ||
) | ||
}) | ||
expect(await $.elementByCss('.nested').text()).toBe('Red due to nesting') | ||
expect(await $.elementByCss('.nested').getComputedCss('color')).toBe( | ||
'rgb(255, 0, 0)' | ||
) | ||
}) | ||
} | ||
) | ||
}) | ||
}) |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test wasn't actually running with Turbopack as far as I can tell.