mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-26 22:26:05 +00:00
* chore(shadcn): implement registries poc * feat(shadcn): refactor our initial implementation * feat(shadcn): properly resolve namespaced registryDependencies * feat(shadcn): resolve namespaced registries recursively * fix * feat(shadcn): implement dotenv support * test(shadcn): mock shadcn registry * fix * fix * fix * refactor(shadcn): update functions and tests * refactor(shadcn): add fetchFromRegistry (#7937) * fix * feat(shadcn): add shadcn as a built-in registry * fix * feat(shadcn): update no framework and shadcn
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)
})
})