Files
element-call/vitest.config.ts
T

68 lines
1.9 KiB
TypeScript
Raw Normal View History

2024-02-15 22:34:59 -05:00
import { defineConfig, mergeConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import { vitePluginsConfig } from "./vite.config";
import { storybookTest } from "@storybook/addon-vitest/vitest-plugin";
import path from "node:path";
import { fileURLToPath } from "node:url";
const dirname = path.dirname(fileURLToPath(import.meta.url));
2024-02-02 18:54:50 -06:00
2024-02-15 22:34:59 -05:00
export default defineConfig((configEnv) =>
mergeConfig(
vitePluginsConfig(configEnv),
2024-02-15 22:34:59 -05:00
defineConfig({
test: {
fileParallelism: true,
projects: [
{
extends: true,
test: {
2026-05-11 19:16:07 +02:00
name: "unit",
css: {
2026-05-15 18:37:25 +02:00
include: /.+/,
modules: {
classNameStrategy: "non-scoped",
},
},
setupFiles: ["src/vitest.setup.ts"],
environment: "jsdom",
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
},
2024-02-15 22:34:59 -05:00
},
{
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
2026-05-20 13:26:52 +02:00
configDir: "./.storybook",
}),
...vitePluginsConfig(configEnv).plugins!,
],
test: {
name: "storybook",
browser: {
enabled: true,
// Make sure to install Playwright
provider: playwright(),
headless: true,
2026-05-11 19:29:07 +02:00
instances: [{ browser: "chromium" }],
},
},
},
],
2024-02-15 22:34:59 -05:00
coverage: {
reporter: ["html", "json"],
2026-04-17 11:13:41 +02:00
include: ["src/**/*.{ts,tsx,js,jsx}"],
exclude: [
2026-04-17 11:13:41 +02:00
"src/**/*.md",
2026-04-08 16:38:52 +02:00
"src/**/*.{d,test,stories}.{ts,tsx}",
"src/utils/test.ts",
"src/utils/test-viewmodel.ts",
"src/utils/test-fixtures.ts",
"playwright/**",
],
2024-02-15 22:34:59 -05:00
},
},
}),
),
);