mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
Relocates ui/litellm-dashboard/e2e_tests to tests/e2e/ui so all end to end suites live under tests/e2e. The suite stays in TypeScript and becomes a self-contained npm package with its own package.json, lockfile and tsconfig instead of leaning on the dashboard's toolchain; the dashboard drops its @playwright/test dependency, e2e scripts and knip/vitest/tsconfig carve-outs. CI paths follow the move: both CircleCI jobs (main e2e and the SERVER_ROOT_PATH migration smoke) and the test_server_root_path workflow now install and run Playwright from tests/e2e/ui, with the node cache keyed on both lockfiles. classify_changes.sh treats tests/e2e/ui as client so spec edits keep skipping backend jobs. The suite's mock LLM fixture is excluded from the e2e basedpyright zero-error gate in pyrightconfig.json since it belongs to the TS suite, not the typed Python harness.
63 lines
1.6 KiB
TypeScript
63 lines
1.6 KiB
TypeScript
import { defineConfig, type Plugin, type ViteUserConfig } from "vitest/config";
|
|
import { resolve } from "path";
|
|
|
|
const staticImageData: Plugin = {
|
|
name: "next-static-image-data",
|
|
enforce: "pre",
|
|
load(id: string) {
|
|
const path = id.split("?")[0];
|
|
if (!/\.(svg|png|jpe?g|gif|webp|avif|ico|bmp)$/i.test(path)) return undefined;
|
|
const name = path.slice(path.lastIndexOf("/") + 1);
|
|
return `export default { src: ${JSON.stringify(`/_next/static/media/${name}`)}, height: 24, width: 24 };`;
|
|
},
|
|
};
|
|
|
|
const config: ViteUserConfig = {
|
|
plugins: [staticImageData],
|
|
test: {
|
|
environment: "jsdom",
|
|
setupFiles: ["tests/setupTests.ts"],
|
|
globals: true,
|
|
css: true, // lets you import CSS/modules without extra mocks
|
|
testTimeout: 30000,
|
|
silent: process.env.CI ? "passed-only" : false,
|
|
teardownTimeout: 60000,
|
|
coverage: {
|
|
provider: "v8",
|
|
reporter: ["text", "lcov"],
|
|
include: ["src/**/*.{ts,tsx}"],
|
|
exclude: [
|
|
"**/*.d.ts",
|
|
"**/*.test.*",
|
|
"**/*.spec.*",
|
|
|
|
"tests/**",
|
|
|
|
"node_modules/**",
|
|
".next/**",
|
|
"out/**",
|
|
|
|
"**/*.config.*",
|
|
"postcss.config.*",
|
|
"tailwind.config.*",
|
|
"next.config.*",
|
|
],
|
|
},
|
|
exclude: ["node_modules/**"],
|
|
include: ["src/**/*.test.ts", "src/**/*.test.tsx", "tests/**/*.test.ts", "tests/**/*.test.tsx"],
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": resolve(__dirname, "src"),
|
|
},
|
|
},
|
|
define: {
|
|
"import.meta.vitest": "undefined",
|
|
},
|
|
esbuild: {
|
|
jsx: "automatic",
|
|
jsxImportSource: "react",
|
|
},
|
|
};
|
|
|
|
export default defineConfig(config);
|