unit-tests

Evaluate and write unit tests for bklit-ui utility functions.

1.5k|89|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/bklit/bklit-ui --skill unit-tests-bklit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-tests
Source: https://github.com/bklit/bklit-ui/tree/main/.agents/skills/unit-tests
Command: npx skills add https://github.com/bklit/bklit-ui --skill unit-tests-bklit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the common problem of over-testing in bklit-ui, where teams waste time writing brittle, low-signal tests that fail to catch real user-facing regressions and add unnecessary maintenance overhead.

Core Features & Use Cases

  • Clear testing guardrails: Explicit guidance on what to test (pure functions, formatters, edge cases) and what to skip (component smoke tests, third-party library behavior, trivial wrappers) to avoid wasted effort.
  • Repo-specific conventions: Standardized patterns for test runner setup, file placement, and test structure that align with bklit-ui's existing codebase.
  • Decision support: A pre-writing checklist to quickly evaluate if a test is worth implementing, ensuring tests only lock in behavior that is easy to break silently.
  • Use Case: When adding a new chart formatter function, this skill guides you to write a focused equivalence test instead of brittle component render tests that break on minor UI changes.

Quick Start

Use the unit-tests skill to evaluate if a new utility function in bklit-ui needs a unit test and follow the repo's standard test pattern to implement it correctly.

Frequently Asked Questions about unit-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to avoid over-testing pure utility functions in a UI component library?

Unit testing pure utility functions requires focused equivalence tests for formatters and edge case logic, while deliberately skipping brittle component render tests to avoid wasted effort and maintenance overhead.

How do I write unit tests for chart math and formatters without creating brittle tests?

Write unit tests for chart math by targeting pure functions and edge cases rather than UI component rendering, applying a pre-writing checklist to ensure tests only lock in behavior that is easy to break silently.

When do I need unit tests for utility functions and when should I skip them?

You need unit tests for pure functions, formatters, and edge case logic that is easy to break silently. Skip tests for component smoke tests, third-party library behavior, and trivial wrappers to reduce maintenance overhead.

What are the test file placement and test runner conventions for an open source UI component library?

Standardized test conventions enforce specific test runner setup, test file placement rules, and test structure patterns, ensuring new tests align with the existing repo codebase and structural guardrails.

Why do my UI component smoke tests keep breaking on minor visual changes?

UI component smoke tests break on minor visual changes because they are brittle low-signal tests. Avoid testing third-party library behavior and instead write focused equivalence tests for pure utility functions.