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

Commit 82615b5

Browse files
committed
test(build-in.test.ts): add
1 parent 4daf0a3 commit 82615b5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/build-in.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { buildIn, isServer } from '../src/_internal';
2+
import { readFileSync, writeFileSync } from 'fs';
3+
4+
const filePath = '../src/core/styles/style.module.css';
5+
6+
test('buildIn should append styleSheet to style file and verify its content', () => {
7+
if (!isServer) return;
8+
const styleSheet = '.test-style { color: red; }';
9+
10+
// Run the test
11+
buildIn(styleSheet);
12+
13+
// Check the file contents
14+
const fileContent = readFileSync(filePath, 'utf-8');
15+
expect(fileContent).toContain(styleSheet);
16+
17+
// Cleanup: Reset file contents after testing
18+
writeFileSync(filePath, '/*_*/', 'utf-8');
19+
});

0 commit comments

Comments
 (0)