MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getSharedVitestConfig

Function getSharedVitestConfig

vitest.shared.ts:8–37  ·  view source on GitHub ↗
({
  __dirname: dirname,
}: {
  __dirname: string;
})

Source from the content-addressed store, hash-verified

6const rootTestSetup = (dirname: string) => path.resolve(dirname, '../../test/test-setup.ts');
7
8export const getSharedVitestConfig = ({
9 __dirname: dirname,
10}: {
11 __dirname: string;
12}) => {
13 return defineConfig({
14 resolve: {
15 alias: {
16 '@': path.resolve(dirname, 'src'),
17 },
18 },
19 test: {
20 setupFiles: [rootTestSetup(dirname)],
21 env: {
22 // Always point at local Docker — never production, regardless of .env
23 DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/postgres?schema=public',
24 CLICKHOUSE_URL: 'http://localhost:8123/openpanel',
25 REDIS_URL: 'redis://localhost:6379',
26 SELF_HOSTED: 'true',
27 },
28 include: ['**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
29 browser: {
30 name: 'chromium',
31 provider: 'playwright',
32 headless: true,
33 },
34 fakeTimers: { toFake: undefined },
35 },
36 });
37};

Callers 7

vitest.config.tsFile · 0.90
vitest.config.tsFile · 0.90
vitest.config.tsFile · 0.90
vitest.config.tsFile · 0.90
vitest.config.tsFile · 0.90
vitest.config.tsFile · 0.90
vitest.config.tsFile · 0.90

Calls 1

rootTestSetupFunction · 0.85

Tested by

no test coverage detected