Skip to content

.tip

· one of the small things

A builder per entity, with sensible defaults

Test setup that builds a full Order with twelve fields every time is noise, and the one field the test cares about gets lost in it.

const order = buildOrder({ status: "shipped" }); // everything else valid and boring

The builder owns the defaults. When the entity gets a new required field, you change one builder instead of two hundred tests.

testing