Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ jobs:

- name: Build
run: vp run build

- name: Test dev server
run: vp run test:dev
4 changes: 4 additions & 0 deletions apps/dashboard/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { defineConfig } from "vite-plus";
// https://vite.dev/config/
export default defineConfig({
plugins: [tailwindcss()],
experimental: {
// Vitest does not support bundled dev mode: https://github.com/vitest-dev/vitest/issues/11052
bundledDev: !process.env.VITEST,
},
build: {
rolldownOptions: {
output: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"prepare": "vp config",
"dev": "vp run @vibe/dashboard#dev",
"build": "vp run @vibe/dashboard#build",
"test:dev": "playwright test",
"deploy": "vp run build && void deploy --platform void --project vibe-dashboard --dir apps/dashboard/dist --spa",
"generate": "node tools/override-vite.mjs --stats"
},
Expand Down
23 changes: 23 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from "playwright/test";

const baseURL = "http://127.0.0.1:4173";

export default defineConfig({
testDir: "./tests/dev",
outputDir: ".cache/playwright",
forbidOnly: true,
workers: 1,
reporter: "list",
use: {
browserName: "chromium",
baseURL,
},
webServer: {
command: "vp dev apps/dashboard --host 127.0.0.1 --port 4173 --strictPort",
url: baseURL,
reuseExistingServer: false,
timeout: 60_000,
stdout: "pipe",
env: { VITEST: "" },
},
});
656 changes: 329 additions & 327 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ catalog:
tailwindcss: ^4.1.13
top-github-dependents-by-stars: ^1.0.4
typescript: ^7.0.0
vite-plus: 1.3.0
vite: npm:@voidzero-dev/vite-plus-core@1.3.0
vite-plus: 1.4.0
vite: npm:@voidzero-dev/vite-plus-core@1.4.0
vitest: 5.0.5
void: 1.1.11
"@vitest/browser-playwright": 5.0.5
Expand Down
28 changes: 28 additions & 0 deletions tests/dev/dashboard.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { expect, test } from "playwright/test";

test("vp dev renders the dashboard and lazy routes", async ({ page }) => {
const errors: string[] = [];
page.on("pageerror", (error) => errors.push(error.message));
page.on("console", (message) => {
if (message.type() === "error") errors.push(message.text());
});

const response = await page.goto("/");
expect(response?.ok()).toBe(true);
await expect(
page.getByRole("heading", { name: "VoidZero Dashboard", exact: true }),
).toBeVisible();

await page
.getByRole("main")
.getByRole("link", { name: /Minification Benchmarks/ })
.click();
await expect(page).toHaveURL("/#/minification");
const heading = page.getByRole("heading", { name: "Minification Benchmarks", exact: true });
await expect(heading).toBeVisible();

const reloadResponse = await page.reload();
expect(reloadResponse?.ok()).toBe(true);
await expect(heading).toBeVisible();
expect(errors).toEqual([]);
});
Loading