mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
ac5a54ee1d
Wires `@chat-adapter/tests` as a devDependency and registers its matchers via `setupFiles: ["@chat-adapter/tests/setup"]` across all 11 platform adapters, then replaces bespoke local `mockLogger`/`createMockState`/`createMockChatInstance` with the shared factories and adopts `toHaveDispatched`/`not.toHaveDispatched` where clean. - 10 adapters migrated (gchat, messenger, teams, whatsapp, telegram, discord, twilio, linear, github, slack). Positional `createMockChatInstance(...)` call sites converted to the options API (slack 100, linear 35). - `web` left as-is — its suite uses the real `Chat`/`createMemoryState` for e2e, so the shared factories don't apply. - Platform SDK mocks (Octokit, WebClient, socket-mode, `@linear/sdk`, `fetch`) and the Phase 1 `connectWebhookContract` descriptors are left intact. Net ~−540 lines of duplicated test scaffolding. Stacked on #673. Tests-only, no changeset. --------- Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com> Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
16 lines
345 B
TypeScript
16 lines
345 B
TypeScript
import { defineProject } from "vitest/config";
|
|
|
|
export default defineProject({
|
|
test: {
|
|
globals: true,
|
|
environment: "node",
|
|
setupFiles: ["@chat-adapter/tests/setup"],
|
|
coverage: {
|
|
provider: "v8",
|
|
reporter: ["text", "json-summary"],
|
|
include: ["src/**/*.ts"],
|
|
exclude: ["src/**/*.test.ts"],
|
|
},
|
|
},
|
|
});
|