Install the tests that ship with components
Add the vitest tests Ballmac runs on a component, keep them updated with it, and run them in your project.
On this page
Most free components come with the test we run on them: keyboard use, states and ARIA, written with vitest and Testing Library.
Add tests when you install
pnpm dlx @ballmac/cli add dialog --with-testsnpx @ballmac/cli add dialog --with-testsyarn dlx @ballmac/cli add dialog --with-testsbun x @ballmac/cli add dialog --with-testsAdd tests for items you already have
pnpm dlx @ballmac/cli test add buttonnpx @ballmac/cli test add buttonyarn dlx @ballmac/cli test add buttonbun x @ballmac/cli test add buttonRun every Ballmac test
pnpm dlx @ballmac/cli testnpx @ballmac/cli testyarn dlx @ballmac/cli testbun x @ballmac/cli testWhat gets installed
Tests go in __tests__ next to the components, with one shared setup.ts. The tool installs the packages they need at versions known to work together (vitest, jsdom, Testing Library, the React plugin) and, if you have no vitest config yet, creates one with your @ alias.
Pages for components that have a test say so. A test is yours once installed, and it is updated with the component: your additions are merged like any other file.
Close the loop with an agent
After an AI agent edits a component, it can run the test and fix what it broke. The MCP tool get_tests returns the test for an item.