Skip to main content

BettererTest

API > @betterer/betterer > BettererTest

The main interface to the Betterer test system.

Signature

export declare class BettererTest<DeserialisedType, SerialisedType = DeserialisedType, DiffType = null> implements BettererTestBase<DeserialisedType, SerialisedType, DiffType> 
Implements: BettererTestBase<DeserialisedType, SerialisedType, DiffType>

Example

import { BettererTest } from '@betterer/betterer';
import { smaller } from '@betterer/constraints';
import glob from 'glob';

const test = new BettererTest({
test: () => glob.sync('**\/*').length,
constraint: smaller
});

Constructors

ConstructorModifiersDescription
(constructor)(options)Constructs a new instance of the BettererTest class

Properties

PropertyModifiersTypeDescription
configBettererTestConfig<DeserialisedType, SerialisedType, DiffType>The complete configuration for the test.
isOnlybooleanWhen true, all other tests will be skipped. Calling only() will set this to true.
isSkippedbooleanWhen true, this test will be skipped. Calling skip() will set this to true.

Methods

MethodModifiersDescription
constraint(constraintOverride)Override the constraint in the test configuration.
deadline(deadlineOverride)Override the deadline in the test configuration.
goal(goalOverride)Override the goal in the test configuration.
only()Run only this test. All other tests will be marked as skipped.
skip()Skip this test.