You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/vite.config.ts

68 lines
2.2 KiB

import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vitest/config';
import { playwright } from '@vitest/browser-playwright';
import { sveltekit } from '@sveltejs/kit/vite';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import { resolveUixAliases } from './uix.aliases.js';
// __dirname no existe en ESM — se reconstruye así
const __dirname = dirname(fileURLToPath(import.meta.url));
const aliases = resolveUixAliases(__dirname);
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
resolve: { alias: aliases },
test: {
expect: { requireAssertions: true },
projects: [
{
extends: './vite.config.ts',
test: {
name: 'client',
browser: {
enabled: true,
provider: playwright(),
// Default: chromium (fast dev loop). `UIX_CROSS_BROWSER=1` adds
// WebKit + Firefox — the floating-engine parity suite must agree
// with @floating-ui on all three (the isWebKit-gated paths only
// run on WebKit). Requires `npx playwright install webkit firefox`.
instances: process.env.UIX_CROSS_BROWSER
? [
{ browser: 'chromium', headless: true },
{ browser: 'webkit', headless: true },
{ browser: 'firefox', headless: true }
]
: [{ browser: 'chromium', headless: true }]
},
include: ['src/**/*.svelte.{test,spec}.{js,ts}']
}
},
{
extends: './vite.config.ts',
resolve: { alias: aliases },
test: {
name: 'server',
environment: 'node',
// Signed flaky policy (P0 gate, 2026-08-26): explicit wall-clock
// budgets instead of the vitest defaults (5s test / 10s hook).
// Under a full parallel run these limits measure transform/import
// cost, not test slowness (measured: 5210s aggregate import under
// load vs ~1s solitary — orca's beforeEach import, cookie-adapter,
// soma-attr-audit, recipe-css-contract all timed out as "flaky").
// A failing assert still fails instantly; hang-lock tests keep
// their explicit short per-test timeouts (component-guide §A36).
testTimeout: 30_000,
hookTimeout: 30_000,
include: ['src/**/*.{test,spec}.{js,ts}'],
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}']
}
}
]
}
});

Powered by TurnKey Linux.