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>
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
Constructor | Modifiers | Description |
---|---|---|
(constructor)(options) | Constructs a new instance of the BettererTest class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
config | BettererTestConfig<DeserialisedType, SerialisedType, DiffType> | The complete configuration for the test. | |
isOnly | boolean | When true , all other tests will be skipped. Calling only() will set this to true . | |
isSkipped | boolean | When true , this test will be skipped. Calling skip() will set this to true . |
Methods
Method | Modifiers | Description |
---|---|---|
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. |