Home / File/ update-fonts.test.ts — ui Source File

update-fonts.test.ts — ui Source File

Architecture documentation for update-fonts.test.ts, a typescript file in the ui codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  abc53e7d_e788_42c1_5281_5d48cd66ef4e["update-fonts.test.ts"]
  b169f1bf_76c5_e7c9_f493_15fe0f296591["update-fonts.ts"]
  abc53e7d_e788_42c1_5281_5d48cd66ef4e --> b169f1bf_76c5_e7c9_f493_15fe0f296591
  fb488c27_d35b_ddbe_26c7_6bfb5c38105a["transformLayoutFonts"]
  abc53e7d_e788_42c1_5281_5d48cd66ef4e --> fb488c27_d35b_ddbe_26c7_6bfb5c38105a
  c8d55bee_7008_1e1f_317b_8dc47b31b6a8["vitest"]
  abc53e7d_e788_42c1_5281_5d48cd66ef4e --> c8d55bee_7008_1e1f_317b_8dc47b31b6a8
  style abc53e7d_e788_42c1_5281_5d48cd66ef4e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { describe, expect, it } from "vitest"

import { transformLayoutFonts } from "./update-fonts"

const mockConfig = {
  style: "new-york",
  rsc: true,
  tsx: true,
  tailwind: {
    config: "tailwind.config.js",
    css: "app/globals.css",
    baseColor: "neutral",
    cssVariables: true,
  },
  aliases: {
    components: "@/components",
    utils: "@/lib/utils",
    ui: "@/components/ui",
    lib: "@/lib",
    hooks: "@/hooks",
  },
  resolvedPaths: {
    cwd: "/test",
    tailwindConfig: "/test/tailwind.config.js",
    tailwindCss: "/test/app/globals.css",
    utils: "/test/lib/utils.ts",
    components: "/test/components",
    lib: "/test/lib",
    hooks: "/test/hooks",
    ui: "/test/components/ui",
  },
} as any

describe("transformLayoutFonts", () => {
  it("should add a single Google font to empty layout", async () => {
    const input = `
import type { Metadata } from "next"
import "./globals.css"

export const metadata: Metadata = {
  title: "My App",
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  )
}
`
    const fonts = [
      {
        name: "inter",
        type: "registry:font" as const,
        font: {
// ... (701 more lines)

Frequently Asked Questions

What does update-fonts.test.ts do?
update-fonts.test.ts is a source file in the ui codebase, written in typescript. It belongs to the FrameworkTooling domain.
What does update-fonts.test.ts depend on?
update-fonts.test.ts imports 3 module(s): transformLayoutFonts, update-fonts.ts, vitest.
Where is update-fonts.test.ts in the architecture?
update-fonts.test.ts is located at packages/shadcn/src/utils/updaters/update-fonts.test.ts (domain: FrameworkTooling, directory: packages/shadcn/src/utils/updaters).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free