s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← Reference

Reference

Test through the same contracts applications use

Use package test helpers, temporary databases, generated manifests, and focused component tests instead of replacing framework behavior with unrelated mocks.

Start with the smallest real boundary

Unit-test pure model behavior directly. Use the collection and temporary database helpers for persistence. Add route or browser tests only when behavior crosses those interfaces.

Generate the manifest in tests

Scan the objects under test during test setup. Load consumed package manifests. Decorators, inheritance, interfaces, and migrations then behave as they do in the application build.

Test security decisions explicitly

Cover anonymous, permitted, denied, cross-tenant, sensitive-field, read-only-field, and agent-confirmation cases. A passing happy path is not evidence that the boundary fails closed.