@types/lab

  • Version 11.1.4
  • Published
  • 8.11 kB
  • No dependencies
  • MIT license

Install

npm i @types/lab
yarn add @types/lab
pnpm add @types/lab

Overview

TypeScript definitions for lab

Index

Variables

variable assertions

const assertions: any;
  • Access the configured assertion library.

Functions

function script

script: (options?: ScriptOptions) => Lab & ExperimentAlt & TestAlt;
  • The test script.

Interfaces

interface AsyncOptions

interface AsyncOptions {}

    property timeout

    timeout?: number | undefined;
    • Set a specific timeout in milliseconds (disabled)

    interface DoneNote

    interface DoneNote {}

      property note

      note: (text: string) => void;
      • Attach a note to the test case

      interface ExperimentAlt

      interface ExperimentAlt {}

        property describe

        describe: SkipOnlyExperiment;

          property experiment

          experiment: SkipOnlyExperiment;

            property suite

            suite: SkipOnlyExperiment;

              interface ExperimentOptions

              interface ExperimentOptions {}

                property only

                only?: boolean | undefined;
                • Execute only this test/experiment? (false)

                property parallel

                parallel?: boolean | undefined;
                • Execute tests in parallel? (false)

                property skip

                skip?: boolean | undefined;
                • Skip execution? (false)

                property timeout

                timeout?: number | undefined;
                • Set a specific timeout in milliseconds (2000)

                interface Lab

                interface Lab {}

                  method after

                  after: {
                  (cb: AsyncCallback): void;
                  (promise: AsyncPromise): void;
                  (options: AsyncOptions, cb: AsyncCallback): void;
                  (options: AsyncOptions, promise: AsyncPromise): void;
                  };
                  • Perform async actions after the test suite

                  • Perform async actions after the test suite using a promise

                  • Perform async actions after the test suite with options

                  • Perform async actions after the test suite with options, using a promise

                  method afterEach

                  afterEach: {
                  (cb: AsyncCallback): void;
                  (promise: AsyncPromise): void;
                  (options: AsyncOptions, cb: AsyncCallback): void;
                  (options: AsyncOptions, promise: AsyncPromise): void;
                  };
                  • Perform async actions after each test

                  • Perform async actions after each test using a promise

                  • Perform async actions after each test with options

                  • Perform async actions after each test with options, using a promise

                  method before

                  before: {
                  (cb: AsyncCallback): void;
                  (promise: AsyncPromise): void;
                  (options: AsyncOptions, cb: AsyncCallback): void;
                  (options: AsyncOptions, promise: AsyncPromise): void;
                  };
                  • Perform async actions before the test suite

                  • Perform async actions before the test suite using a promise

                  • Perform async actions before the test suite with options

                  • Perform async actions before the test suite with otions, using a promise

                  method beforeEach

                  beforeEach: {
                  (cb: AsyncCallback): void;
                  (promise: AsyncPromise): void;
                  (options: AsyncOptions, cb: AsyncCallback): void;
                  (options: AsyncOptions, promise: AsyncPromise): void;
                  };
                  • Perform async actions before each test

                  • Perform async actions before each test using a promise

                  • Perform async actions before each test with options

                  • Perform async actions before each test with options, using a promise

                  method describe

                  describe: {
                  (desc: string, cb: EmptyCallback): void;
                  (desc: string, options: ExperimentOptions, cb: EmptyCallback): void;
                  };
                  • Create a test suite

                  • Create a test suite with options

                  method experiment

                  experiment: {
                  (desc: string, cb: EmptyCallback): void;
                  (desc: string, options: ExperimentOptions, cb: EmptyCallback): void;
                  };
                  • Organise tests into an experiment

                  • Organise tests into an experiment with options

                  method it

                  it: {
                  (desc: string, cb: TestCallback): void;
                  (desc: string, promise: TestPromise): void;
                  (desc: string, options: TestOptions, cb: TestCallback): void;
                  (desc: string, options: TestOptions, promise: TestPromise): void;
                  };
                  • The test spec

                  • The test spec using a promise

                  • The test spec with options

                  • The test spec using a promise with options

                  method suite

                  suite: {
                  (desc: string, cb: EmptyCallback): void;
                  (desc: string, options: ExperimentOptions, cb: EmptyCallback): void;
                  };
                  • Create a test suite

                  • Create a test suite with options

                  method test

                  test: {
                  (desc: string, cb: TestCallback): void;
                  (desc: string, promise: TestPromise): void;
                  (desc: string, options: TestOptions, cb: TestCallback): void;
                  (desc: string, options: TestOptions, promise: TestPromise): void;
                  };
                  • The test spec

                  • The test spec using a promise

                  • The test spec with options

                  • The test spec using a promise with options

                  interface ScriptOptions

                  interface ScriptOptions {}

                    property cli

                    cli?: any;
                    • Pass Lab CLI options

                    property schedule

                    schedule?: boolean | undefined;
                    • Enable auto-execution of the script? (true)

                    interface SkipOnlyExperiment

                    interface SkipOnlyExperiment {}

                      property only

                      only: ExperimentArgs & ExperimentWithOptionsArgs;
                      • Only execute this test suite

                      property skip

                      skip: ExperimentArgs & ExperimentWithOptionsArgs;
                      • Skip this test suite

                      interface SkipOnlyTest

                      interface SkipOnlyTest {}

                        property only

                        only: TestArgs & TestWithOptionsArgs;
                        • Only execute this test

                        property skip

                        skip: TestArgs & TestWithOptionsArgs;
                        • Skip this test

                        interface TestAlt

                        interface TestAlt {}

                          property it

                          it: SkipOnlyTest;

                            property test

                            test: SkipOnlyTest;

                              interface TestOptions

                              interface TestOptions extends ExperimentOptions {}

                                property plan

                                plan?: number | undefined;
                                • The expected number of assertions to execute

                                Type Aliases

                                type AsyncCallback

                                type AsyncCallback = (done: DoneFunction) => void;

                                  type AsyncPromise

                                  type AsyncPromise = () => Promise<any>;

                                    type CleanupFunction

                                    type CleanupFunction = (func: (next: Function) => void) => void;

                                      type DoneFunction

                                      type DoneFunction = (err?: Error) => void;

                                        type EmptyCallback

                                        type EmptyCallback = () => void;

                                          type ExperimentArgs

                                          type ExperimentArgs = (desc: string, cb: EmptyCallback) => {};

                                            type ExperimentWithOptionsArgs

                                            type ExperimentWithOptionsArgs = (
                                            desc: string,
                                            options: ExperimentOptions,
                                            cb: EmptyCallback
                                            ) => {};

                                              type TestArgs

                                              type TestArgs = (desc: string, cb: TestCallback) => {};

                                                type TestCallback

                                                type TestCallback = (
                                                done: DoneFunction & DoneNote,
                                                onCleanup?: CleanupFunction
                                                ) => void;

                                                  type TestPromise

                                                  type TestPromise = () => Promise<any>;

                                                    type TestWithOptionsArgs

                                                    type TestWithOptionsArgs = (
                                                    desc: string,
                                                    options: TestOptions,
                                                    cb: TestCallback
                                                    ) => {};

                                                      Package Files (1)

                                                      Dependencies (0)

                                                      No dependencies.

                                                      Dev Dependencies (0)

                                                      No dev dependencies.

                                                      Peer Dependencies (0)

                                                      No peer dependencies.

                                                      Badge

                                                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/lab.

                                                      • Markdown
                                                        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/lab)
                                                      • HTML
                                                        <a href="https://www.jsdocs.io/package/@types/lab"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>