Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
✅ Set up unit testing in @rallly/ui and move markdown-description test (RAL-1332) (#2649)
Luke Vella4c2dad0e4f28
diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex 1ba9dbb81..34af00e10 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -8,6 +8,7 @@"check": "biome check .","check:fix": "biome check . --write","ui:add": "npx shadcn-ui@latest add",+ "test:unit": "vitest run","type-check": "tsc --noEmit"},"exports": {@@ -42,8 +43,12 @@},"devDependencies": {"@rallly/tsconfig": "workspace:*",+ "@testing-library/react": "^16.3.0","@types/react": "19.2.13","@types/react-dom": "19.2.3",- "unified": "^11.0.5"+ "@vitejs/plugin-react": "^5.0.0",+ "jsdom": "^26.1.0",+ "unified": "^11.0.5",+ "vitest": "^4.0.16"}}diff --git a/apps/web/src/features/poll/components/markdown-description.test.tsx b/packages/ui/src/markdown-description.test.tsxsimilarity index 98%rename from apps/web/src/features/poll/components/markdown-description.test.tsxrename to packages/ui/src/markdown-description.test.tsxindex 9c7838688..7d4a4202d 100644--- a/apps/web/src/features/poll/components/markdown-description.test.tsx+++ b/packages/ui/src/markdown-description.test.tsx@@ -1,6 +1,6 @@-import { MarkdownDescription } from "@rallly/ui/markdown-description";import { render } from "@testing-library/react";import { describe, expect, it } from "vitest";+import { MarkdownDescription } from "./markdown-description";function renderMarkdown(content: string) {const { container } = render(<MarkdownDescription content={content} />);diff --git a/packages/ui/vitest.config.mts b/packages/ui/vitest.config.mtsnew file mode 100644index 000000000..32cb08157--- /dev/null+++ b/packages/ui/vitest.config.mts@@ -0,0 +1,10 @@+import react from "@vitejs/plugin-react";+import { defineConfig } from "vitest/config";++export default defineConfig({+ plugins: [react()],+ test: {+ environment: "jsdom",+ include: ["src/**/*.test.{ts,tsx}"],+ },+});diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 6a0ba62d1..76820ad38 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -825,15 +825,27 @@ importers:'@rallly/tsconfig':specifier: workspace:*version: link:../tsconfig+ '@testing-library/react':+ specifier: ^16.3.0+ version: 16.3.2(@testing-library/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@types/react':specifier: 19.2.13version: 19.2.13'@types/react-dom':specifier: 19.2.3version: 19.2.3(@types/[email protected])+ '@vitejs/plugin-react':+ specifier: ^5.0.0+ version: 5.1.3([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ jsdom:+ specifier: ^26.1.0+ version: 26.1.0unified:specifier: ^11.0.5version: 11.0.5+ vitest:+ specifier: ^4.0.16+ version: 4.0.18(@opentelemetry/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])packages/utils:dependencies: