Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 38a0210

Browse files
committed
test(*): global and root are written at the same time.
1 parent 566bfde commit 38a0210

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

e2e/site/app/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ const css = cssx.create({
99
},
1010
});
1111

12+
cssx.global({
13+
h1: {
14+
color: 'cyan',
15+
},
16+
});
17+
18+
cssx.root({
19+
'--color-skyblue': 'skyblue',
20+
});
21+
1222
export default function Home() {
1323
return (
1424
<main>

e2e/site/component/style-create.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ const css = cssx.create({
1111
},
1212
});
1313

14-
cssx.global({
15-
h1: {
16-
color: 'aqua',
17-
},
18-
});
19-
2014
export function E2ETest() {
2115
return (
2216
<div className={css.e2e} data-testid="e2e-test-div">

test/compiler-integration.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ test('CSS compilation logs contain expected output', async () => {
1515
expect(stdout).toContain('color: pink;');
1616
expect(stdout).toContain('@media (max-width: 1024px)');
1717
expect(stdout).toContain('color: aqua;');
18+
// It will also be compiled if global and root are written at the same time.
19+
expect(stdout).toContain('Generating global static css');
20+
expect(stdout).toContain('color: cyan');
21+
expect(stdout).toContain('--color-skyblue: skyblue');
1822
}, 15000);

0 commit comments

Comments
 (0)