Skip to main content

Frontend engineering · Code quality

Unit Test

Also called: Unit tests, Unit testing, Function-level tests

Fast, narrow automated checks around a function, component, or module—great for edge cases and regressions.

In detail

Unit tests isolate a small unit: given input X, expect output Y or error Z. On the frontend that includes pure functions, hooks, and component renders (often with a testing library).

They are fast for CI, but they won't catch real-browser layout or cross-service issues—that's what end-to-end tests are for. When AI writes code, adding unit tests first cuts thrash.

Test behavior, not implementation trivia, or refactors will break everything.

Developer info
Term ID
eng-unit-test
DOM selectors
No DOM cues. This concept isn't detected directly on a page.
Priority
1 · when several match at the same level, the higher priority wins
Version
v1 · updated Oct 5, 2026