diff --git a/e2e/cases/css/css-minimize/index.test.ts b/e2e/cases/css/css-minimize/index.test.ts index 46b49d911d..1cc0f6062d 100644 --- a/e2e/cases/css/css-minimize/index.test.ts +++ b/e2e/cases/css/css-minimize/index.test.ts @@ -13,7 +13,7 @@ rspackOnlyTest('should minimize CSS correctly by default', async () => { files[Object.keys(files).find((file) => file.endsWith('.css'))!]; expect(content).toEqual( - '.a{text-align:center;line-height:1.5;font-size:1.5rem}.b{text-align:center;line-height:1.5;font-size:1.5rem;background:#fafafa}', + '.a{text-align:center;text-align:center;font-size:1.5rem;line-height:1.5}.b{text-align:center;background:#fafafa;font-size:1.5rem;line-height:1.5}', ); }); diff --git a/e2e/cases/css/css-modules-composes/index.test.ts b/e2e/cases/css/css-modules-composes/index.test.ts index 5a980d0768..406820e2a3 100644 --- a/e2e/cases/css/css-modules-composes/index.test.ts +++ b/e2e/cases/css/css-modules-composes/index.test.ts @@ -1,8 +1,8 @@ import path from 'node:path'; -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should compile CSS Modules composes correctly', async () => { +rspackOnlyTest('should compile CSS Modules composes correctly', async () => { const rsbuild = await build({ cwd: __dirname, }); @@ -12,25 +12,28 @@ test('should compile CSS Modules composes correctly', async () => { files[Object.keys(files).find((file) => file.endsWith('.css'))!]; expect(content).toMatch( - /.*\{background:red;color:yellow\}.*\{background:blue\}/, + /.*\{color:#ff0;background:red\}.*\{background:#00f\}/, ); }); -test('should compile CSS Modules composes with external correctly', async () => { - const rsbuild = await build({ - cwd: __dirname, - rsbuildConfig: { - source: { - entry: { external: path.resolve(__dirname, './src/external.js') }, +rspackOnlyTest( + 'should compile CSS Modules composes with external correctly', + async () => { + const rsbuild = await build({ + cwd: __dirname, + rsbuildConfig: { + source: { + entry: { external: path.resolve(__dirname, './src/external.js') }, + }, }, - }, - }); - const files = await rsbuild.unwrapOutputJSON(); + }); + const files = await rsbuild.unwrapOutputJSON(); - const content = - files[Object.keys(files).find((file) => file.endsWith('.css'))!]; + const content = + files[Object.keys(files).find((file) => file.endsWith('.css'))!]; - expect(content).toMatch( - /.*\{background:cyan;color:black\}.*\{background:green\}/, - ); -}); + expect(content).toMatch( + /.*\{color:#000;background:#0ff\}.*\{background:green\}/, + ); + }, +); diff --git a/e2e/cases/css/css-modules-exports-global/index.test.ts b/e2e/cases/css/css-modules-exports-global/index.test.ts index 61c1015292..1efb089491 100644 --- a/e2e/cases/css/css-modules-exports-global/index.test.ts +++ b/e2e/cases/css/css-modules-exports-global/index.test.ts @@ -1,43 +1,45 @@ -import { build, dev, gotoPage } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; - -test('should exports global in CSS Modules correctly in dev build', async ({ - page, -}) => { - const rsbuild = await dev({ - cwd: __dirname, - }); - - await gotoPage(page, rsbuild); - - const test1Locator = page.locator('#test1'); - await expect(test1Locator).toHaveCSS('color', 'rgb(255, 0, 0)'); - - const test2Locator = page.locator('#test2'); - await expect(test2Locator).toHaveCSS('color', 'rgb(0, 0, 255)'); - - await rsbuild.close(); -}); - -test('should exports global in CSS Modules correctly in prod build', async ({ - page, -}) => { - const rsbuild = await build({ - cwd: __dirname, - runServer: true, - }); - await gotoPage(page, rsbuild); - - const test1Locator = page.locator('#test1'); - await expect(test1Locator).toHaveCSS('color', 'rgb(255, 0, 0)'); - - const test2Locator = page.locator('#test2'); - await expect(test2Locator).toHaveCSS('color', 'rgb(0, 0, 255)'); - - await rsbuild.close(); - - const files = await rsbuild.unwrapOutputJSON(); - const content = - files[Object.keys(files).find((file) => file.endsWith('.css'))!]; - expect(content).toMatch(/\.foo-\w{6}{color:red}\.bar{color:blue}/); -}); +import { build, dev, gotoPage, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; + +rspackOnlyTest( + 'should exports global in CSS Modules correctly in dev build', + async ({ page }) => { + const rsbuild = await dev({ + cwd: __dirname, + }); + + await gotoPage(page, rsbuild); + + const test1Locator = page.locator('#test1'); + await expect(test1Locator).toHaveCSS('color', 'rgb(255, 0, 0)'); + + const test2Locator = page.locator('#test2'); + await expect(test2Locator).toHaveCSS('color', 'rgb(0, 0, 255)'); + + await rsbuild.close(); + }, +); + +rspackOnlyTest( + 'should exports global in CSS Modules correctly in prod build', + async ({ page }) => { + const rsbuild = await build({ + cwd: __dirname, + runServer: true, + }); + await gotoPage(page, rsbuild); + + const test1Locator = page.locator('#test1'); + await expect(test1Locator).toHaveCSS('color', 'rgb(255, 0, 0)'); + + const test2Locator = page.locator('#test2'); + await expect(test2Locator).toHaveCSS('color', 'rgb(0, 0, 255)'); + + await rsbuild.close(); + + const files = await rsbuild.unwrapOutputJSON(); + const content = + files[Object.keys(files).find((file) => file.endsWith('.css'))!]; + expect(content).toMatch(/\.foo-\w{6}{color:red}\.bar{color:#00f}/); + }, +); diff --git a/e2e/cases/css/css-modules-named-export/index.test.ts b/e2e/cases/css/css-modules-named-export/index.test.ts index f591334212..cc1789ba03 100644 --- a/e2e/cases/css/css-modules-named-export/index.test.ts +++ b/e2e/cases/css/css-modules-named-export/index.test.ts @@ -21,7 +21,7 @@ rspackOnlyTest( files[Object.keys(files).find((file) => file.endsWith('.css'))!]; expect(content).toMatch( - /\.classA-\w{6}{color:red}\.classB-\w{6}{color:blue}\.classC-\w{6}{color:yellow}/, + /\.classA-\w{6}{color:red}\.classB-\w{6}{color:#00f}\.classC-\w{6}{color:#ff0}/, ); await gotoPage(page, rsbuild); diff --git a/e2e/cases/css/css-modules/index.test.ts b/e2e/cases/css/css-modules/index.test.ts index 4c09ce7fdd..3f23374cce 100644 --- a/e2e/cases/css/css-modules/index.test.ts +++ b/e2e/cases/css/css-modules/index.test.ts @@ -1,7 +1,7 @@ -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should compile CSS Modules correctly', async () => { +rspackOnlyTest('should compile CSS Modules correctly', async () => { const rsbuild = await build({ cwd: __dirname, }); @@ -11,71 +11,80 @@ test('should compile CSS Modules correctly', async () => { files[Object.keys(files).find((file) => file.endsWith('.css'))!]; expect(content).toMatch( - /\.the-a-class{color:red}\.the-b-class-\w{6}{color:blue}\.the-c-class-\w{6}{color:yellow}\.the-d-class{color:green}/, + /\.the-a-class{color:red}\.the-b-class-\w{6}{color:#00f}\.the-c-class-\w{6}{color:#ff0}\.the-d-class{color:green}/, ); }); -test('should compile CSS Modules follow by output.cssModules', async () => { - const rsbuild = await build({ - cwd: __dirname, - rsbuildConfig: { - output: { - cssModules: { - auto: (resource) => { - return resource.includes('.scss'); +rspackOnlyTest( + 'should compile CSS Modules follow by output.cssModules', + async () => { + const rsbuild = await build({ + cwd: __dirname, + rsbuildConfig: { + output: { + cssModules: { + auto: (resource) => { + return resource.includes('.scss'); + }, }, }, }, - }, - }); - const files = await rsbuild.unwrapOutputJSON(); + }); + const files = await rsbuild.unwrapOutputJSON(); - const content = - files[Object.keys(files).find((file) => file.endsWith('.css'))!]; + const content = + files[Object.keys(files).find((file) => file.endsWith('.css'))!]; - expect(content).toMatch( - /.the-a-class{color:red}.the-b-class-\w{6}{color:blue}.the-c-class{color:yellow}.the-d-class{color:green}/, - ); -}); + expect(content).toMatch( + /.the-a-class{color:red}.the-b-class-\w{6}{color:#00f}.the-c-class{color:#ff0}.the-d-class{color:green}/, + ); + }, +); -test('should compile CSS Modules follow by output.cssModules custom localIdentName', async () => { - const rsbuild = await build({ - cwd: __dirname, - rsbuildConfig: { - output: { - cssModules: { - localIdentName: '[hash:base64:8]', +rspackOnlyTest( + 'should compile CSS Modules follow by output.cssModules custom localIdentName', + async () => { + const rsbuild = await build({ + cwd: __dirname, + rsbuildConfig: { + output: { + cssModules: { + localIdentName: '[hash:base64:8]', + }, }, }, - }, - }); - const files = await rsbuild.unwrapOutputJSON(); + }); + const files = await rsbuild.unwrapOutputJSON(); - const content = - files[Object.keys(files).find((file) => file.endsWith('.css'))!]; + const content = + files[Object.keys(files).find((file) => file.endsWith('.css'))!]; - expect(content).toMatch( - /\.the-a-class{color:red}\.\w{8}{color:blue}\.\w{8}{color:yellow}\.the-d-class{color:green}/, - ); -}); + expect(content).toMatch( + /\.the-a-class{color:red}\.\w{8}{color:#00f}\.\w{8}{color:#ff0}\.the-d-class{color:green}/, + ); + }, +); -test('should compile CSS Modules follow by output.cssModules custom localIdentName - hashDigest', async () => { - const rsbuild = await build({ - cwd: __dirname, - rsbuildConfig: { - output: { - cssModules: { - localIdentName: '[hash:hex:4]', +rspackOnlyTest( + 'should compile CSS Modules follow by output.cssModules custom localIdentName - hashDigest', + async () => { + const rsbuild = await build({ + cwd: __dirname, + rsbuildConfig: { + output: { + cssModules: { + localIdentName: '[hash:hex:4]', + }, }, }, - }, - }); - const files = await rsbuild.unwrapOutputJSON(); + }); + const files = await rsbuild.unwrapOutputJSON(); - const content = - files[Object.keys(files).find((file) => file.endsWith('.css'))!]; + const content = + files[Object.keys(files).find((file) => file.endsWith('.css'))!]; - expect(content).toMatch( - /\.the-a-class{color:red}\.\w{4}{color:blue}\.\w{4}{color:yellow}\.the-d-class{color:green}/, - ); -}); + expect(content).toMatch( + /\.the-a-class{color:red}\.\w{4}{color:#00f}\.\w{4}{color:#ff0}\.the-d-class{color:green}/, + ); + }, +); diff --git a/e2e/cases/css/import-common-css/index.test.ts b/e2e/cases/css/import-common-css/index.test.ts index 5b929574d9..a357932264 100644 --- a/e2e/cases/css/import-common-css/index.test.ts +++ b/e2e/cases/css/import-common-css/index.test.ts @@ -1,7 +1,7 @@ -import { build, proxyConsole } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, proxyConsole, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should compile common css import correctly', async () => { +rspackOnlyTest('should compile common CSS import correctly', async () => { const { restore, logs } = proxyConsole(); const rsbuild = await build({ @@ -24,7 +24,7 @@ test('should compile common css import correctly', async () => { ); expect(files[cssFiles]).toEqual( - 'html{min-height:100%}#a{color:red}#b{color:blue}', + 'html{min-height:100%}#a{color:red}#b{color:#00f}', ); restore(); diff --git a/e2e/cases/css/import-loaders/index.test.ts b/e2e/cases/css/import-loaders/index.test.ts index c4ff6870b2..3681f217dd 100644 --- a/e2e/cases/css/import-loaders/index.test.ts +++ b/e2e/cases/css/import-loaders/index.test.ts @@ -1,16 +1,19 @@ -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should compile CSS Modules which depends on importLoaders correctly', async () => { - const rsbuild = await build({ - cwd: __dirname, - }); - const files = await rsbuild.unwrapOutputJSON(); +rspackOnlyTest( + 'should compile CSS Modules which depends on importLoaders correctly', + async () => { + const rsbuild = await build({ + cwd: __dirname, + }); + const files = await rsbuild.unwrapOutputJSON(); - const content = - files[Object.keys(files).find((file) => file.endsWith('.css'))!]; + const content = + files[Object.keys(files).find((file) => file.endsWith('.css'))!]; - expect(content).toEqual( - '.class-foo-yQ8Tl7+.hello-class-foo{background-color:red}.class-bar-TVH2T6 .hello-class-bar{background-color:blue}', - ); -}); + expect(content).toEqual( + '.class-foo-yQ8Tl7+.hello-class-foo{background-color:red}.class-bar-TVH2T6 .hello-class-bar{background-color:#00f}', + ); + }, +); diff --git a/e2e/cases/css/less-inline-js/index.test.ts b/e2e/cases/css/less-inline-js/index.test.ts index 688355a4df..bf983dec32 100644 --- a/e2e/cases/css/less-inline-js/index.test.ts +++ b/e2e/cases/css/less-inline-js/index.test.ts @@ -9,5 +9,5 @@ test('should compile less inline js correctly', async () => { const files = await rsbuild.unwrapOutputJSON(); const cssFiles = Object.keys(files).find((file) => file.endsWith('.css'))!; - expect(files[cssFiles]).toEqual('body{width:200}'); + expect(files[cssFiles]).toEqual('body{opacity:.2}'); }); diff --git a/e2e/cases/css/less-inline-js/src/a.less b/e2e/cases/css/less-inline-js/src/a.less index 42dff8c753..f5479b2b0c 100644 --- a/e2e/cases/css/less-inline-js/src/a.less +++ b/e2e/cases/css/less-inline-js/src/a.less @@ -1,7 +1,7 @@ -@a: `function(width) { - return (width + 100); +@a: `function(val) { + return (val + 0.1); }`; body { - width: `(@{a})(100)`; + opacity: `(@{a})(0.1)`; } diff --git a/e2e/cases/css/multi-css/index.test.ts b/e2e/cases/css/multi-css/index.test.ts index 2ea1069895..1a7e7fef2d 100644 --- a/e2e/cases/css/multi-css/index.test.ts +++ b/e2e/cases/css/multi-css/index.test.ts @@ -1,8 +1,8 @@ import path from 'node:path'; -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should emit multiple css files correctly', async () => { +rspackOnlyTest('should emit multiple css files correctly', async () => { const rsbuild = await build({ cwd: __dirname, rsbuildConfig: { @@ -28,6 +28,6 @@ test('should emit multiple css files correctly', async () => { )!; expect(files[entry1CSS]).toContain('#entry1{color:red}'); - expect(files[entry2CSS]).toContain('#entry2{color:blue}'); + expect(files[entry2CSS]).toContain('#entry2{color:#00f}'); expect(files[entry3CSS]).toContain('#entry3{color:green}'); }); diff --git a/e2e/cases/css/nested-npm-import/index.test.ts b/e2e/cases/css/nested-npm-import/index.test.ts index f818fc2cf4..3dadf8b9a6 100644 --- a/e2e/cases/css/nested-npm-import/index.test.ts +++ b/e2e/cases/css/nested-npm-import/index.test.ts @@ -1,9 +1,9 @@ import fs from 'node:fs'; import path from 'node:path'; -import { build, proxyConsole } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, proxyConsole, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should compile nested npm import correctly', async () => { +rspackOnlyTest('should compile nested npm import correctly', async () => { const { restore, logs } = proxyConsole(); fs.cpSync( @@ -20,7 +20,7 @@ test('should compile nested npm import correctly', async () => { const cssFiles = Object.keys(files).find((file) => file.endsWith('.css'))!; expect(files[cssFiles]).toEqual( - '#b{color:yellow}#c{color:green}#a{font-size:10px}html{font-size:18px}', + '#b{color:#ff0}#c{color:green}#a{font-size:10px}html{font-size:18px}', ); // there will be a deprecation log for `~`. diff --git a/e2e/cases/css/relative-import/index.test.ts b/e2e/cases/css/relative-import/index.test.ts index 82915f0c9d..b90b8cd432 100644 --- a/e2e/cases/css/relative-import/index.test.ts +++ b/e2e/cases/css/relative-import/index.test.ts @@ -1,7 +1,7 @@ -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should compile CSS relative imports correctly', async () => { +rspackOnlyTest('should compile CSS relative imports correctly', async () => { const rsbuild = await build({ cwd: __dirname, }); @@ -10,5 +10,5 @@ test('should compile CSS relative imports correctly', async () => { const content = files[Object.keys(files).find((file) => file.endsWith('.css'))!]; - expect(content).toContain('.foo{color:red}.bar{color:blue}.baz{color:green}'); + expect(content).toContain('.foo{color:red}.bar{color:#00f}.baz{color:green}'); }); diff --git a/e2e/cases/css/resolve-alias/index.test.ts b/e2e/cases/css/resolve-alias/index.test.ts index d24c332460..2fd7d55ef4 100644 --- a/e2e/cases/css/resolve-alias/index.test.ts +++ b/e2e/cases/css/resolve-alias/index.test.ts @@ -1,7 +1,7 @@ -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should compile CSS with alias correctly', async () => { +rspackOnlyTest('should compile CSS with alias correctly', async () => { const rsbuild = await build({ cwd: __dirname, }); @@ -11,6 +11,6 @@ test('should compile CSS with alias correctly', async () => { files[Object.keys(files).find((file) => file.endsWith('.css'))!]; expect(content).toMatch( - /\.the-a-class{color:red;background-image:url\(\/static\/image\/icon\.\w{8}\.png\)}\.the-b-class{color:blue;background-image:url\(\/static\/image\/icon\.\w{8}\.png\)}\.the-c-class{color:yellow;background-image:url\(\/static\/image\/icon\.\w{8}\.png\)}/, + /\.the-a-class{color:red;background-image:url\(\/static\/image\/icon\.\w{8}\.png\)}\.the-b-class{color:#00f;background-image:url\(\/static\/image\/icon\.\w{8}\.png\)}\.the-c-class{color:#ff0;background-image:url\(\/static\/image\/icon\.\w{8}\.png\)}/, ); }); diff --git a/e2e/cases/plugin-api/plugin-transform/index.test.ts b/e2e/cases/plugin-api/plugin-transform/index.test.ts index 42b71311be..4122cb48af 100644 --- a/e2e/cases/plugin-api/plugin-transform/index.test.ts +++ b/e2e/cases/plugin-api/plugin-transform/index.test.ts @@ -1,7 +1,7 @@ -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; -test('should allow plugin to transform code', async () => { +rspackOnlyTest('should allow plugin to transform code', async () => { const rsbuild = await build({ cwd: __dirname, }); @@ -18,6 +18,6 @@ test('should allow plugin to transform code', async () => { ); expect(files[indexJs!].includes('world')).toBeTruthy(); - expect(files[indexCss!].includes('blue')).toBeTruthy(); + expect(files[indexCss!].includes('#00f')).toBeTruthy(); expect(files[helloTxt!].includes('hello world')).toBeTruthy(); }); diff --git a/e2e/cases/stylus-rem/index.test.ts b/e2e/cases/stylus-rem/index.test.ts index 9845846243..e691a663ea 100644 --- a/e2e/cases/stylus-rem/index.test.ts +++ b/e2e/cases/stylus-rem/index.test.ts @@ -1,9 +1,9 @@ -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; import { pluginRem } from '@rsbuild/plugin-rem'; import { pluginStylus } from '@rsbuild/plugin-stylus'; -test('should compile stylus and rem correctly', async () => { +rspackOnlyTest('should compile stylus and rem correctly', async () => { const rsbuild = await build({ cwd: __dirname, plugins: [pluginStylus(), pluginRem()], @@ -14,6 +14,6 @@ test('should compile stylus and rem correctly', async () => { files[Object.keys(files).find((file) => file.endsWith('.css'))!]; expect(content).toMatch( - /body{color:#f00;font:\.28rem Arial,sans-serif}\.title-class-\w{6}{font-size:\.28rem}/, + /body{color:red;font:\.28rem Arial,sans-serif}\.title-class-\w{6}{font-size:\.28rem}/, ); }); diff --git a/e2e/cases/stylus/index.test.ts b/e2e/cases/stylus/index.test.ts index d4044b2289..b56742e0d0 100644 --- a/e2e/cases/stylus/index.test.ts +++ b/e2e/cases/stylus/index.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import { join, resolve } from 'node:path'; -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; +import { build, rspackOnlyTest } from '@e2e/helper'; +import { expect } from '@playwright/test'; import { pluginStylus } from '@rsbuild/plugin-stylus'; import { pluginTypedCSSModules } from '@rsbuild/plugin-typed-css-modules'; @@ -14,29 +14,32 @@ const generatorTempDir = async (testDir: string) => { return () => fs.promises.rm(testDir, { force: true, recursive: true }); }; -test('should compile stylus correctly with ts declaration', async () => { - const testDir = join(fixtures, 'test-temp-src-1'); - const clear = await generatorTempDir(testDir); - - const rsbuild = await build({ - cwd: __dirname, - plugins: [pluginStylus(), pluginTypedCSSModules()], - rsbuildConfig: { - source: { - entry: { index: resolve(testDir, 'index.js') }, +rspackOnlyTest( + 'should compile stylus correctly with ts declaration', + async () => { + const testDir = join(fixtures, 'test-temp-src-1'); + const clear = await generatorTempDir(testDir); + + const rsbuild = await build({ + cwd: __dirname, + plugins: [pluginStylus(), pluginTypedCSSModules()], + rsbuildConfig: { + source: { + entry: { index: resolve(testDir, 'index.js') }, + }, }, - }, - }); - const files = await rsbuild.unwrapOutputJSON(); + }); + const files = await rsbuild.unwrapOutputJSON(); - const content = - files[Object.keys(files).find((file) => file.endsWith('.css'))!]; + const content = + files[Object.keys(files).find((file) => file.endsWith('.css'))!]; - expect(content).toMatch( - /body{color:#f00;font:14px Arial,sans-serif}\.title-class-\w{6}{font-size:14px}/, - ); + expect(content).toMatch( + /body{color:red;font:14px Arial,sans-serif}\.title-class-\w{6}{font-size:14px}/, + ); - expect(fs.existsSync(join(testDir, './b.module.styl.d.ts'))).toBeTruthy(); + expect(fs.existsSync(join(testDir, './b.module.styl.d.ts'))).toBeTruthy(); - await clear(); -}); + await clear(); + }, +); diff --git a/e2e/cases/typed-css-modules/basic/index.test.ts b/e2e/cases/typed-css-modules/basic/index.test.ts index 6063199f9e..e488e96436 100644 --- a/e2e/cases/typed-css-modules/basic/index.test.ts +++ b/e2e/cases/typed-css-modules/basic/index.test.ts @@ -79,7 +79,7 @@ test('generator TS declaration for cssModules.auto function', async () => { output: { cssModules: { auto: (path) => { - return path.endsWith('.less'); + return path.endsWith('.scss'); }, }, }, @@ -87,9 +87,9 @@ test('generator TS declaration for cssModules.auto function', async () => { }); expect(fs.existsSync(join(testDir, './a.css.d.ts'))).toBeFalsy(); - expect(fs.existsSync(join(testDir, './b.module.scss.d.ts'))).toBeFalsy(); - expect(fs.existsSync(join(testDir, './c.module.less.d.ts'))).toBeTruthy(); - expect(fs.existsSync(join(testDir, './d.global.less.d.ts'))).toBeTruthy(); + expect(fs.existsSync(join(testDir, './b.module.scss.d.ts'))).toBeTruthy(); + expect(fs.existsSync(join(testDir, './c.module.less.d.ts'))).toBeFalsy(); + expect(fs.existsSync(join(testDir, './d.global.less.d.ts'))).toBeFalsy(); await clear(); }); diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 20e2f4b837..599bc6b1a5 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -285,7 +285,7 @@ export const CHAIN_ID = { MINIMIZER: { /** SwcJsMinimizerRspackPlugin */ JS: 'js', - /** SwcCssMinimizerRspackPlugin */ + /** LightningCssMinimizerRspackPlugin */ CSS: 'css', }, /** Predefined resolve plugins */