Skip to content

Commit f9c924c

Browse files
committed
chore:update CI to individual tests vs test:all
1 parent 91d0c2a commit f9c924c

File tree

7 files changed

+31
-13
lines changed

7 files changed

+31
-13
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,34 @@ jobs:
6868
- name: Lint
6969
run: pnpm lint
7070

71-
# 7 ▸ Run Build
71+
# 7 ▸ Install Lockfile
72+
- name: Install Lockfile
73+
run: pnpm install --frozen-lockfile
74+
75+
# 8 ▸ Run Build
7276
- name: Run Build
73-
run: pnpm bootstrap
77+
run: pnpm build
78+
79+
# 9 ▸ Run Prepack
80+
- name: Run Prepack
81+
run: pnpm prepack:core
82+
83+
# 10 ▸ Run Install Tarball
84+
- name: Run Install Tarball
85+
run: pnpm i-tarball
7486

75-
# 8 ▸ Run all tests
87+
# 11 ▸ Run all tests
7688
- name: Run Vite tests
77-
run: pnpm test
89+
run: pnpm test:vite
90+
91+
- name: Run Next.js tests
92+
run: pnpm test:next
93+
94+
- name: Run unit tests
95+
run: pnpm test:unit
96+
97+
- name: Run CLI tests
98+
run: pnpm test:cli
99+
100+
- name: Run unit tests 2
101+
run: pnpm test:unit-2

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"test:vite": "cd packages/core && pnpm test:vite",
1919
"test:next": "cd packages/core && pnpm test:next",
2020
"test:unit": "cd packages/core && pnpm test:unit",
21+
"test:unit-2": "cd packages/core && pnpm test:ts",
2122
"test:cli": "cd packages/core && pnpm test:cli",
2223
"format": "prettier --write .",
2324
"lint": "eslint .",
@@ -36,4 +37,4 @@
3637
"tsx": "^4.20.3",
3738
"typescript": "^5.8.3"
3839
}
39-
}
40+
}

packages/core/__tests__/unit/ast.test.cjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export function ComponentSimple() {
105105

106106
async () => {
107107
const variants = extractVariants('src/app/Component.jsx');
108-
console.log('variants: ', variants);
109108
assert.strictEqual(variants.length, 2);
110109
assert.strictEqual(variants.length, 2);
111110

@@ -174,7 +173,6 @@ function TestComponent() {
174173
},
175174
async () => {
176175
const variants = extractVariants('src/app/Component.jsx');
177-
console.log('variants: ', variants);
178176
assert.strictEqual(variants.length, 3);
179177
}
180178
);

packages/core/__tests__/unit/index.test.cjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ test('ignores node_modules and hidden directories', async () => {
256256
`,
257257
},
258258
(result) => {
259-
console.log('result: ', result.css);
260259
assert(result.css.includes('@custom-variant valid-yes'), 'Should process valid files');
261260
assert(!result.css.includes('ignored'), 'Should ignore node_modules');
262261
assert(!result.css.includes('hidden'), 'Should ignore hidden directories');
@@ -281,7 +280,6 @@ test('handles large projects efficiently - 500 files', async function () {
281280
const startTime = Date.now();
282281

283282
await runTest(files, (result) => {
284-
console.log('handles large projects efficiently-result: ', result.css);
285283
const endTime = Date.now();
286284
const duration = endTime - startTime;
287285

@@ -291,7 +289,7 @@ test('handles large projects efficiently - 500 files', async function () {
291289
assert(result.css.includes('@custom-variant state49-value49'), 'Should process all files');
292290

293291
// Should complete in reasonable time
294-
assert(duration < 300, 'Should process 50 files in under 300ms');
292+
assert(duration < 500, 'Should process 500 files in under 500ms');
295293
});
296294
});
297295

packages/core/src/postcss/ast-generating.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ const FIXTURES = {
5757
test('parseAndUpdateViteConfig inserts Zero-UI and removes Tailwind', () => {
5858
for (const [name, src] of Object.entries(FIXTURES)) {
5959
const out = parseAndUpdateViteConfig(src, zeroUiVitePlugin);
60-
console.log('out: ', out);
6160
assert(out && out.includes(zeroUiVitePlugin), `${name} missing zeroUI`);
6261
assert(out.includes('zeroUI()'), `${name} missing zeroUI`);
6362
assert(out.includes('react()'), `${name} missing react`);

packages/core/src/postcss/helpers.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ export default { plugins: [react(),tailwindcss()] };`,
285285
async () => {
286286
await patchViteConfig();
287287
const cfg = readFile('vite.config.mjs');
288-
console.log('cfg: ', cfg);
289288
assert.ok(cfg.includes('@react-zero-ui/core/vite'), 'Zero-UI plugin missing');
290289
assert.ok(!cfg.includes('@tailwindcss/vite'), 'Tailwind should be removed');
291290
}

packages/core/src/postcss/scanner.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,5 @@ test('scanVariantTokens', () => {
3535
`;
3636
// should return theme-three-light, theme-three-dark
3737
const result = scanVariantTokens(src, new Set(['theme-three']));
38-
console.log('result: ', result);
3938
assert.deepStrictEqual(result.get('theme-three'), new Set(['light', 'dark']));
4039
});

0 commit comments

Comments
 (0)