Files
element-call-Github/vitest.config.ts
T
Timo K.andClaude Fable 5.1 9910496b90 Add the MatrixRTC SDK package, its harness and a failing smoke test
Set up `sdk/` as a package shaped exactly like `component/`: its own
package.json with peer dependencies, the pnpm workspace marker so a host can
install it as a git dependency, a build tsconfig for type emission, and a vite
lib config with an externals list that `pnpm lint:externals` now checks for
both library builds.

The package holds only the interface for now. `createRtcSession` returns an
empty object; `RtcSession`, `RtcMember`, `MemberMedia` and `TransportMetadata`
are the contract Element Call's `CallViewModel` will be rebuilt on (see
sdk-plan.md). The shared primitives are re-exported from `src` until the first
implementation slice moves them.

`sdk/dev` is the smallest consumer of the SDK: a plain page that logs in, joins
a room and renders one tile per member, served by `pnpm dev:sdk` on port 3002.
Playwright starts it as a third web server, and `playwright/sdk/smoke.spec.ts`
has two browsers join one session. It fails on the status line with the SDK's
own error until there is an implementation behind the interface.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-08 13:53:56 +02:00

69 lines
2.0 KiB
TypeScript

import { defineConfig, mergeConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import { vitePluginsConfig } from "./vite.config.ts";
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));
export default defineConfig((configEnv) =>
mergeConfig(
vitePluginsConfig(configEnv),
defineConfig({
test: {
fileParallelism: true,
projects: [
{
extends: true,
test: {
name: "unit",
css: { include: /.+/ },
setupFiles: ["src/vitest.setup.ts"],
environment: "jsdom",
include: [
"src/**/*.test.ts",
"src/**/*.test.tsx",
"component/**/*.test.ts",
"component/**/*.test.tsx",
"sdk/**/*.test.ts",
],
},
},
{
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
configDir: "./.storybook",
}),
...vitePluginsConfig(configEnv).plugins!,
],
test: {
name: "storybook",
browser: {
enabled: true,
// Make sure to install Playwright
provider: playwright(),
headless: true,
instances: [{ browser: "chromium" }],
},
},
},
],
coverage: {
reporter: ["html", "json"],
include: ["src/**/*.{ts,tsx,js,jsx}"],
exclude: [
"src/**/*.md",
"src/**/*.{d,test,stories}.{ts,tsx}",
"src/utils/test.ts",
"src/utils/test-viewmodel.ts",
"src/utils/test-fixtures.ts",
"playwright/**",
],
},
},
}),
),
);