chore: update test webServer to use preview mode
CI / Generate Certificates (pull_request) Successful in 30s
CI / Frontend CI (pull_request) Successful in 1m9s
CI / Backend CI (pull_request) Successful in 1m8s
CI / E2E Tests (pull_request) Successful in 6m26s

This commit is contained in:
me
2026-05-06 22:48:31 +05:30
parent 548b34fb51
commit e8d589d06d
3 changed files with 75 additions and 69 deletions
+68 -68
View File
@@ -1,70 +1,70 @@
{ {
"name": "frontend", "name": "frontend",
"private": true, "private": true,
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc -b & vite build", "build": "tsc -b & vite build",
"build:prod": "vite build --mode production", "build:prod": "vite build --mode production",
"lint": "biome lint --write ./src", "lint": "biome lint --write ./src",
"format": "biome format --write ./src", "format": "biome format --write ./src",
"check": "biome check --write ./src", "check": "biome check --write ./src",
"check-all": "biome check --write .", "check-all": "biome check --write .",
"preview": "vite preview", "preview": "vite preview",
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest", "test:watch": "vitest",
"test:coverage": "vitest run --coverage", "test:coverage": "vitest run --coverage",
"test:e2e": "playwright test", "test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui --ui-host=0.0.0.0 --ui-port=43008" "test:e2e:ui": "playwright test --ui --ui-host=0.0.0.0 --ui-port=43008"
}, },
"dependencies": { "dependencies": {
"@fontsource-variable/jost": "^5.2.8", "@fontsource-variable/jost": "^5.2.8",
"@fontsource-variable/playfair-display": "^5.2.8", "@fontsource-variable/playfair-display": "^5.2.8",
"@fontsource-variable/playwrite-hr-lijeva": "^5.2.7", "@fontsource-variable/playwrite-hr-lijeva": "^5.2.7",
"@fontsource/architects-daughter": "^5.2.7", "@fontsource/architects-daughter": "^5.2.7",
"@fontsource/cutive-mono": "^5.2.8", "@fontsource/cutive-mono": "^5.2.8",
"@fontsource/kavivanar": "^5.2.8", "@fontsource/kavivanar": "^5.2.8",
"@fontsource/knewave": "^5.2.7", "@fontsource/knewave": "^5.2.7",
"@fontsource/redacted-script": "^5.2.8", "@fontsource/redacted-script": "^5.2.8",
"@fontsource/space-mono": "^5.2.9", "@fontsource/space-mono": "^5.2.9",
"@hookform/resolvers": "^5.2.2", "@hookform/resolvers": "^5.2.2",
"@phosphor-icons/react": "^2.1.10", "@phosphor-icons/react": "^2.1.10",
"@tailwindcss/vite": "^4.2.2", "@tailwindcss/vite": "^4.2.2",
"axios": "^1.15.0", "axios": "^1.15.0",
"daisyui": "^5.5.19", "daisyui": "^5.5.19",
"fabric": "^7.2.0", "fabric": "^7.2.0",
"idb": "^8.0.3", "idb": "^8.0.3",
"lenis": "^1.3.23", "lenis": "^1.3.23",
"motion": "^12.38.0", "motion": "^12.38.0",
"react": "^19.2.4", "react": "^19.2.4",
"react-dom": "^19.2.4", "react-dom": "^19.2.4",
"react-hook-form": "^7.72.1", "react-hook-form": "^7.72.1",
"react-router-dom": "^7.14.0", "react-router-dom": "^7.14.0",
"tailwindcss": "^4.2.2", "tailwindcss": "^4.2.2",
"zod": "^4.3.6", "zod": "^4.3.6",
"zustand": "^5.0.12" "zustand": "^5.0.12"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.4.11", "@biomejs/biome": "^2.4.11",
"@playwright/test": "^1.59.1", "@playwright/test": "^1.59.1",
"@testing-library/jest-dom": "^6.9.1", "@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2", "@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1", "@testing-library/user-event": "^14.6.1",
"@types/node": "^25.6.0", "@types/node": "^25.6.0",
"@types/react": "^19.2.14", "@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-basic-ssl": "^2.3.0", "@vitejs/plugin-basic-ssl": "^2.3.0",
"@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-react": "^6.0.1",
"@vitest/coverage-v8": "^4.1.4", "@vitest/coverage-v8": "^4.1.4",
"dotenv": "^17.4.2", "dotenv": "^17.4.2",
"fake-indexeddb": "^6.2.5", "fake-indexeddb": "^6.2.5",
"jsdom": "^29.0.2", "jsdom": "^29.0.2",
"msw": "^2.13.2", "msw": "^2.13.2",
"pino": "^10.3.1", "pino": "^10.3.1",
"pino-pretty": "^13.1.3", "pino-pretty": "^13.1.3",
"typescript": "~6.0.2", "typescript": "~6.0.2",
"vite": "^8.0.4", "vite": "^8.0.4",
"vitest": "^4.1.4" "vitest": "^4.1.4"
} }
} }
+2 -1
View File
@@ -60,7 +60,8 @@ export default defineConfig({
/* Run your local dev server before starting the tests */ /* Run your local dev server before starting the tests */
webServer: { webServer: {
command: "npm run dev -- --mode e2e", // NOTE: using npm here for docker compat mainly
command: "npm run build -- --mode e2e && npm run preview -- --mode e2e",
url: getBaseUrl( url: getBaseUrl(
process.env.SSL_ENABLED === "true", process.env.SSL_ENABLED === "true",
process.env.FRONTEND_DOMAIN, process.env.FRONTEND_DOMAIN,
+5
View File
@@ -46,5 +46,10 @@ export default defineConfig(({ mode }) => {
host: env.FRONTEND_DOMAIN, host: env.FRONTEND_DOMAIN,
https: isSslEnabled ? sslCerts : undefined, https: isSslEnabled ? sslCerts : undefined,
}, },
preview: {
port: Number(env.FRONTEND_PORT),
host: env.FRONTEND_DOMAIN,
https: isSslEnabled ? sslCerts : undefined,
},
}; };
}); });