- Add runtime deps: react-query, react-hook-form+zod, zustand, ky, openapi-fetch, better-auth, react-markdown, shiki, recharts, next-themes, nuqs, sonner, cmdk, vaul, embla-carousel-react, motion, date-fns, tailwind-merge, clsx, cva - Add dev tooling: vitest, testing-library, playwright, prettier(+tailwind plugin), husky, lint-staged, jsdom - Wire providers (QueryClient, Theme, NuqsAdapter, Tooltip, Sonner) into layout - Add vitest/playwright/prettier configs + lint-staged pre-commit hook - Add lib/query-client + lib/http (ky) helpers and sample unit test - Fix react-hooks/set-state-in-effect lint errors (use-mobile useSyncExternalStore, carousel async init) - Remove committed Next-generated types/ duplicates (regenerated under .next/types)
20 lines
482 B
TypeScript
20 lines
482 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
export function cn(...classes: Array<string | false | null | undefined>): string {
|
|
return classes.filter(Boolean).join(" ");
|
|
}
|
|
|
|
describe("cn", () => {
|
|
it("joins truthy values", () => {
|
|
expect(cn("a", "b", "c")).toBe("a b c");
|
|
});
|
|
|
|
it("drops falsy values", () => {
|
|
expect(cn("a", false, null, undefined, "b")).toBe("a b");
|
|
});
|
|
|
|
it("returns empty string for no classes", () => {
|
|
expect(cn()).toBe("");
|
|
});
|
|
});
|