Files
shadcn-ui/packages/tests
shadcn ea6086cbcc feat: add preset commands (#10530)
* feat(cli): add preset commands

* docs(skill): update preset command guidance

* docs(cli): document preset commands

* chore: changeset

* fix(cli): refine preset command output

* fix(cli): align preset decode output

* fix(cli): update preset output fields

* docs(changelog): add preset commands entry

* docs(changelog): show preset command output

* docs(changelog): clarify preset resolve examples

* docs(changelog): refine preset examples

* docs(changelog): add preset command sections

* docs(changelog): show preset resolve output

* docs(changelog): clarify preset open example

* docs(changelog): update preset resolve example

* docs: update preset announcement

* docs: link preset announcement to changelog

* test: increase next init timeout
2026-04-28 20:43:16 +04:00
..
2026-03-25 12:50:08 +04:00
2026-04-28 20:43:16 +04:00
2025-07-29 16:31:10 +04:00
2025-07-29 16:31:10 +04:00
fix
2026-03-02 14:22:31 +04:00
2025-07-29 16:31:10 +04:00
2025-07-29 16:31:10 +04:00

Tests

This package contains integration tests that verify the shadcn CLI works correctly with a local registry. The tests run actual CLI commands against test fixtures to ensure files are created and updated properly.

Running Tests

Run the following command from the root of the workspace:

pnpm tests:test

Writing Tests

import {
  createFixtureTestDirectory,
  fileExists,
  npxShadcn,
} from "../utils/helpers"

describe("my test suite", () => {
  it("should do something", async () => {
    // Create a test directory from a fixture
    const testDir = await createFixtureTestDirectory("next-app")

    // Run CLI command
    await npxShadcn(testDir, ["init", "--base-color=neutral"])

    // Make assertions
    expect(await fileExists(path.join(testDir, "components.json"))).toBe(true)
  })
})