Home / File/ registry.test.ts — ui Source File

registry.test.ts — ui Source File

Architecture documentation for registry.test.ts, a typescript file in the ui codebase. 2 imports, 0 dependents.

File typescript 2 imports

Entity Profile

Dependency Diagram

graph LR
  e42bdca1_c1e0_55b5_9969_cb0723269b0a["registry.test.ts"]
  c8d55bee_7008_1e1f_317b_8dc47b31b6a8["vitest"]
  e42bdca1_c1e0_55b5_9969_cb0723269b0a --> c8d55bee_7008_1e1f_317b_8dc47b31b6a8
  7a25f51b_551e_131b_bc51_bd5ccc7c308c["registry"]
  e42bdca1_c1e0_55b5_9969_cb0723269b0a --> 7a25f51b_551e_131b_bc51_bd5ccc7c308c
  style e42bdca1_c1e0_55b5_9969_cb0723269b0a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

import { createFileTreeForRegistryItemFiles } from "@/lib/registry"

describe("createFileTreeForRegistryItemFiles", () => {
  it("should create a nested file tree structure", async () => {
    const files = [
      { path: "page.tsx" },
      { path: "components/foo.tsx" },
      { path: "components/baz.tsx" },
      { path: "components/boo/quip.tsx" },
    ]

    const expectedOutput = [
      { name: "page.tsx", path: "page.tsx" },
      {
        name: "components",
        children: [
          { name: "foo.tsx", path: "components/foo.tsx" },
          { name: "baz.tsx", path: "components/baz.tsx" },
          {
            name: "boo",
            children: [{ name: "quip.tsx", path: "components/boo/quip.tsx" }],
          },
        ],
      },
    ]

    const result = await createFileTreeForRegistryItemFiles(files)
    expect(result).toEqual(expectedOutput)
  })

  it("should return an empty array for empty input", async () => {
    const result = await createFileTreeForRegistryItemFiles([])
    expect(result).toEqual([])
  })
})

Dependencies

  • registry
  • vitest

Frequently Asked Questions

What does registry.test.ts do?
registry.test.ts is a source file in the ui codebase, written in typescript.
What does registry.test.ts depend on?
registry.test.ts imports 2 module(s): registry, vitest.
Where is registry.test.ts in the architecture?
registry.test.ts is located at deprecated/www/lib/registry.test.ts (directory: deprecated/www/lib).

Analyze Your Own Codebase

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

Try Supermodel Free