Skip to content

Commit ee0ecf6

Browse files
committed
test: add tailwind postcss lightningcss
1 parent 890c6fa commit ee0ecf6

File tree

34 files changed

+734
-25
lines changed

34 files changed

+734
-25
lines changed

pnpm-lock.yaml

Lines changed: 406 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/style/css-modules/index.test.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import { join } from 'node:path';
2-
import { buildAndGetResults, getFileBySuffix } from 'test-helper';
2+
import { buildAndGetResults } from 'test-helper';
3+
import { expectFileContainContent } from 'test-helper/vitest';
34
import { expect, test } from 'vitest';
45

5-
function expectFileContainContent(
6-
files: Record<string, string>,
7-
suffix: string,
8-
content: string,
9-
) {
10-
const fileContent = getFileBySuffix(files, suffix);
11-
expect(fileContent).toContain(content);
12-
}
13-
146
test('should extract css-modules successfully in bundle', async () => {
157
const fixturePath = join(__dirname, 'bundle');
168
const { contents } = await buildAndGetResults(fixturePath, 'css');

tests/integration/style/css/bundle-false/rslib.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig({
88
],
99
source: {
1010
entry: {
11-
index: ['../__fixtures__/src/**/*.css'],
11+
index: ['../__fixtures__/basic/src/**/*.css'],
1212
},
1313
},
1414
});

tests/integration/style/css/bundle/rslib.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
lib: [generateBundleEsmConfig(), generateBundleCjsConfig()],
66
source: {
77
entry: {
8-
index: '../__fixtures__/src/import.css',
8+
index: '../__fixtures__/basic/src/import.css',
99
},
1010
},
1111
});

tests/integration/style/css/index.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ test('should extract css successfully in bundle', async () => {
66
const fixturePath = join(__dirname, 'bundle');
77
const { contents } = await buildAndGetResults(fixturePath, 'css');
88
const esmFiles = Object.keys(contents.esm);
9-
109
expect(esmFiles).toMatchInlineSnapshot(`
1110
[
1211
"<ROOT>/tests/integration/style/css/bundle/dist/esm/static/css/index.css",
@@ -25,7 +24,6 @@ test('should extract css successfully in bundle-false', async () => {
2524
const fixturePath = join(__dirname, 'bundle-false');
2625
const { contents } = await buildAndGetResults(fixturePath, 'css');
2726
const esmFiles = Object.keys(contents.esm);
28-
2927
expect(esmFiles).toMatchInlineSnapshot(`
3028
[
3129
"<ROOT>/tests/integration/style/css/bundle-false/dist/esm/import.css",

tests/integration/style/less/index.test.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
import { join } from 'node:path';
2-
import { buildAndGetResults, getFileBySuffix } from 'test-helper';
2+
import { buildAndGetResults } from 'test-helper';
3+
import { expectFileContainContent } from 'test-helper/vitest';
34
import { expect, test } from 'vitest';
45

5-
function expectFileContainContent(
6-
files: Record<string, string>,
7-
suffix: string,
8-
content: string,
9-
) {
10-
const fileContent = getFileBySuffix(files, suffix);
11-
expect(fileContent).toContain(content);
12-
}
13-
146
test('should extract with pluginLess successfully in bundle-false', async () => {
157
const fixturePath = join(__dirname, 'bundle-false');
168
const { contents } = await buildAndGetResults(fixturePath, 'css');
17-
const esmFiles = Object.keys(contents.esm);
189

10+
const esmFiles = Object.keys(contents.esm);
1911
expect(esmFiles).toMatchInlineSnapshot(`
2012
[
2113
"<ROOT>/tests/integration/style/less/bundle-false/dist/esm/index.css",
@@ -37,6 +29,7 @@ test('should extract with pluginLess successfully in bundle-false', async () =>
3729
test('should extract css with pluginLess successfully in bundle', async () => {
3830
const fixturePath = join(__dirname, 'bundle');
3931
const { contents } = await buildAndGetResults(fixturePath, 'css');
32+
4033
const esmFiles = Object.keys(contents.esm);
4134
expect(esmFiles).toMatchInlineSnapshot(`
4235
[
@@ -55,6 +48,7 @@ test('should extract css with pluginLess successfully in bundle', async () => {
5548
test('should extract css with pluginLess successfully in import case', async () => {
5649
const fixturePath = join(__dirname, 'bundle-import');
5750
const { contents } = await buildAndGetResults(fixturePath, 'css');
51+
5852
const esmFiles = Object.keys(contents.esm);
5953
expect(esmFiles).toMatchInlineSnapshot(`
6054
[

0 commit comments

Comments
 (0)