Options that may be passed to any TAP-generating class

interface BaseOpts {
    at?: null | CallSiteLike | CallSiteLikeJSON;
    bail?: boolean;
    buffered?: boolean;
    childId?: number;
    context?: any;
    debug?: boolean;
    diagnostic?: boolean;
    diff?: string;
    doNotWant?: any;
    error?: any;
    errorOrigin?: {
        at?: null | CallSiteLike | CallSiteLikeJSON;
        source?: string;
        stack?: string;
    expired?: string;
    failSkip?: boolean;
    failTodo?: boolean;
    found?: any;
    indent?: string;
    message?: string;
    name?: string;
    omitVersion?: boolean;
    parent?: Base<TapBaseEvents> | TestBase;
    parser?: Parser;
    passes?: boolean;
    pattern?: any;
    preserveWhitespace?: boolean;
    silent?: boolean;
    skip?: string | boolean;
    source?: string;
    stack?: string;
    strict?: boolean;
    tapChildBuffer?: string;
    test?: string;
    time?: number;
    timeout?: number;
    todo?: string | boolean;
    type?: string;
    wanted?: any;

Hierarchy (view full)


bail?: boolean

Bail out on the first failure

buffered?: boolean

True if this test should be buffered, and only processed once complete.

Defaults to true when t.jobs is set to a value greater than 1.

If set false in that case, then the test will NOT be run in parallel, so this provides a way to control the parallelism within a test suite.

childId?: number

Numeric identifier attached to child tests. Most of the time, this is set based on the TAP_CHILD_ID environment variable.

context?: any

Any arbitrary data that is provided to this test object. Often, this is set in a t.before() or t.beforeEach() method. Scalar values are inherited by child tests. Object values are extended in child tests using Object.create().

If not set in the options, this is initialized to a null-prototyped object, so that usage like t.context.foo = 'bar' will work as expected.

This is initialized and set on the Test object in the runMain method, not at construction time. If set explicitly on the Test object in a before hook, then any context specified on options or inherited from the parent test will be ignored.

debug?: boolean

True to output LOTS AND LOTS of noisy debugging information. Set at the top level by the TAP_DEBUG environment variable.

diagnostic?: boolean
diff?: string
doNotWant?: any
error?: any
errorOrigin?: {
    at?: null | CallSiteLike | CallSiteLikeJSON;
    source?: string;
    stack?: string;

Type declaration

expired?: string
failSkip?: boolean

treat skip tests as failures, default false

failTodo?: boolean

treat todo tests as failures, default false

found?: any
message?: string
name?: string

The name of this test

omitVersion?: boolean

Do not emit the TAP version 14 line.

Parent test of this test

passes?: boolean

track passes in the results lists, default false

pattern?: any
preserveWhitespace?: boolean

Do not elide empty lines and other unnecessary whitespace

silent?: boolean

Setting silent:true in a subtest option makes it completely excluded from test output, UNLESS it fails.

This was used historically for a few things which are now implemented with a more sophisticated promise management system, but can be handy in some rare situations.

skip?: string | boolean

Skip this test entirely, emitting a # SKIP directive

source?: string
stack?: string

The stack where this test was initiated

strict?: boolean

Treat any unknown non-TAP data as an error May be set at run-time by the TAP stream using pragma +strict

test?: string
time?: number

The amount of time that this test took to complete.

Typically, this is not set explicitly, but inferred from the actual time spent. However in some cases, it may be reported by the top-level # time=... comment in a TAP subprocess stream.

timeout?: number

Amount of time in milliseconds before this test times out

todo?: string | boolean

Mark this test as to be done later, emitting a # TODO directive

type?: string
wanted?: any

Internal Machinery

indent?: string

Number of spaces that this test is indented.

parser?: Parser

Parser to use for this TAP stream.

tapChildBuffer?: string

The TAP data from a buffered test.

Generated using TypeDoc