Skip to main content

constraints

API > @betterer/constraints

Constraint helpers for writing Betterer tests.

Remarks

A constraint function is responsible for comparing two Betterer test results and determining if the newer result is better, worse or the same.

Enumerations

EnumerationDescription
BettererConstraintResultThe return type of a Betterer constraint function. Used to indicate whether the new result is better, worse or the same than the expected result.

Functions

FunctionDescription
bigger(result, expected)Betterer constraint function for when a numeric result is expected to get bigger.
smaller(result, expected)Betterer constraint function for when a numeric result is expected to get smaller.