Skip to content

Commit e4c32be

Browse files
authored
chore: use vitest projects (#72)
1 parent 2fee767 commit e4c32be

File tree

7 files changed

+33
-16
lines changed

7 files changed

+33
-16
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
- name: Lint code
2727
run: pnpm lint
2828

29+
- name: Install Playwright browsers
30+
run: pnpx playwright install chromium
31+
2932
- name: Run tests
3033
run: pnpm test
3134

apps/dashboard/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "tsc -b && vite build",
99
"preview": "vite preview",
1010
"clean": "rm -rf dist",
11-
"test": "vitest --browser --run"
11+
"test": "vite test"
1212
},
1313
"dependencies": {
1414
"lucide-react": "^0.542.0",
@@ -32,7 +32,6 @@
3232
"playwright": "^1.55.0",
3333
"rolldown-vite": "7.1.5",
3434
"tailwindcss": "^4.1.13",
35-
"typescript": "catalog:",
36-
"vitest": "^3.2.4"
35+
"typescript": "catalog:"
3736
}
3837
}

apps/dashboard/vitest.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import tailwindcss from '@tailwindcss/vite';
2-
import { defineConfig } from 'vitest/config';
2+
import { defineProject } from 'vitest/config';
33

4-
export default defineConfig({
4+
export default defineProject({
55
plugins: [tailwindcss()],
66
base: '/vibe-dashboard/',
77
test: {
88
browser: {
99
enabled: true,
10-
name: 'chromium',
1110
provider: 'playwright',
1211
headless: true,
12+
instances: [
13+
{
14+
browser: 'chromium',
15+
},
16+
],
1317
},
1418
globals: true,
1519
environment: 'happy-dom',

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"private": true,
66
"scripts": {
77
"dev": "pnpm --filter dashboard dev",
8-
"build": "pnpm -r build",
8+
"build": "vite run @vibe/dashboard#build",
99
"lint": "vite lint --type-aware",
10-
"test": "pnpm -r test",
10+
"test": "vite test",
1111
"clean": "pnpm -r clean",
12-
"build-deploy": "pnpm lint && pnpm build",
12+
"build-deploy": "vite run lint && vite run build",
1313
"rolldown:list": "node tool/override-rolldown.mjs --list",
1414
"rolldown:use": "node tool/override-rolldown.mjs",
1515
"rolldown:stats": "node tool/override-rolldown.mjs --stats",
@@ -24,8 +24,9 @@
2424
"author": "",
2525
"license": "MIT",
2626
"devDependencies": {
27-
"@voidzero-dev/vite-plus": "0.0.0-ccbbbea5f9c675fd9a268ddbb5aa1b1606e14cfa",
28-
"oxlint-tsgolint": "^0.2.0"
27+
"@voidzero-dev/vite-plus": "latest",
28+
"oxlint-tsgolint": "^0.2.0",
29+
"vitest": "^3.2.4"
2930
},
3031
"packageManager": "[email protected]",
3132
"dependencies": {

pnpm-lock.yaml

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

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ packages:
55
verifyDepsBeforeRun: install
66

77
catalog:
8-
typescript: ^5.9.2
8+
typescript: ^5.9.2

vitest.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
test: {
5+
projects: [
6+
'apps/*',
7+
'packages/*',
8+
],
9+
},
10+
});

0 commit comments

Comments
 (0)