Skip to main content

bigger()

API > @betterer/constraints > bigger

Betterer constraint function for when a numeric result is expected to get bigger.

Signature

export declare function bigger(result: number, expected: number): BettererConstraintResult;

Parameters

ParameterTypeDescription
resultnumberResult from the current test run.
expectednumberExpected result from the results file.

Returns

BettererConstraintResult

Example

import { bigger } from '@betterer/constraints';

bigger(1, 2); // worse
bigger(1, 1); // worse
bigger(2, 1); // better
bigger(2, 2); // same