Options
All
  • Public
  • Public/Protected
  • All
Menu

test-decorators

Index

Type aliases

AfterAll

AfterAll: function

Type declaration

AfterAllDecorator

AfterAllDecorator: function

Type declaration

    • (target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
    • Parameters

      • target: Object
      • property: string | symbol
      • descriptor: PropertyDescriptor

      Returns PropertyDescriptor

AfterAllFunction

AfterAllFunction: function

Type declaration

    • (instance: any): void
    • Parameters

      • instance: any

      Returns void

AfterEach

AfterEach: function

Type declaration

AfterEachDecorator

AfterEachDecorator: function

Type declaration

    • (target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
    • Parameters

      • target: Object
      • property: string | symbol
      • descriptor: PropertyDescriptor

      Returns PropertyDescriptor

AfterEachFunction

AfterEachFunction: function

Type declaration

    • (instance: any): void
    • Parameters

      • instance: any

      Returns void

BeforeAll

BeforeAll: function

Type declaration

BeforeAllDecorator

BeforeAllDecorator: function

Type declaration

    • (target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
    • Parameters

      • target: Object
      • property: string | symbol
      • descriptor: PropertyDescriptor

      Returns PropertyDescriptor

BeforeAllFunction

BeforeAllFunction: function

Type declaration

    • (instance: any): void
    • Parameters

      • instance: any

      Returns void

BeforeEach

BeforeEach: function

Type declaration

BeforeEachDecorator

BeforeEachDecorator: function

Type declaration

    • (target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
    • Parameters

      • target: Object
      • property: string | symbol
      • descriptor: PropertyDescriptor

      Returns PropertyDescriptor

BeforeEachFunction

BeforeEachFunction: function

Type declaration

    • (instance: any): void
    • Parameters

      • instance: any

      Returns void

Constructable

Constructable: object

Type declaration

  • constructor: function
    • new __type(): T

Describe

Describe: function

Type declaration

DescribeFunction

DescribeFunction: function

Type declaration

    • (): Promise<void> | void
    • Returns Promise<void> | void

It

It: function

Type declaration

ItFunction

ItFunction: function

Type declaration

    • (done?: function): Promise<void> | void
    • Parameters

      • Optional done: function
          • (): void
          • Returns void

      Returns Promise<void> | void

SuiteOptionsInput

SuiteOptionsInput: SuiteOptions | string

TestDecorator

TestDecorator: function

Type declaration

    • (target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
    • Parameters

      • target: Object
      • property: string | symbol
      • descriptor: PropertyDescriptor

      Returns PropertyDescriptor

TestFunction

TestFunction: function

Type declaration

    • (instance: any): void
    • Parameters

      • instance: any

      Returns void

TestOptionsInput

TestOptionsInput: TestOptions<Params> | string

Variables

Let configuration

configuration: ConfigureOptions

global

global: any

Functions

afterAll

  • afterAll<Params>(target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
  • Decorate a method with @afterAll to have it run after any it-calls in the suite are executed.

    Type parameters

    • Params

    Parameters

    • target: Object
    • property: string | symbol
    • descriptor: PropertyDescriptor

    Returns PropertyDescriptor

    The decorated method.

afterEach

  • afterEach<Params>(target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
  • Decorate a method with @afterEach to have it run after each it-call in the suite.

    Type parameters

    • Params

    Parameters

    • target: Object
    • property: string | symbol
    • descriptor: PropertyDescriptor

    Returns PropertyDescriptor

    The decorated method.

beforeAll

  • beforeAll<Params>(target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
  • Decorate a method with @beforeAll to have it run before any it-calls in the suite are executed.

    Type parameters

    • Params

    Parameters

    • target: Object
    • property: string | symbol
    • descriptor: PropertyDescriptor

    Returns PropertyDescriptor

    The decorated method.

beforeEach

  • beforeEach<Params>(target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
  • Decorate a method with @beforeEach to have it run before each it-call in the suite.

    Type parameters

    • Params

    Parameters

    • target: Object
    • property: string | symbol
    • descriptor: PropertyDescriptor

    Returns PropertyDescriptor

    The decorated method.

configure

  • Call this function in the setup code of your test runner to provide the functions to be called for each suite and each test.

    Parameters

    Returns void

getAfterAlls

getAfterEachs

getBeforeAlls

getBeforeEachs

getTests

initializeConfiguration

  • initializeConfiguration(): void
  • Initialize the configuration with some default values working out of the box for jest an mocha.

    Returns void

isSuiteOptionsInput

  • isSuiteOptionsInput(input: any): boolean
  • Checks that the provided object is compatible with the SuiteOptionsInput interface.

    Parameters

    • input: any

      Anything.

    Returns boolean

    true if the input is compatible andfalse` otherwise.

isTestOptionsInput

  • isTestOptionsInput<Params>(input: any): boolean
  • Checks that the provided object is compatible with the TestOptionsInput interface.

    Type parameters

    • Params

    Parameters

    • input: any

      Anything.

    Returns boolean

    true if the input is compatible andfalse` otherwise.

parseSuiteOptions

  • Validates and prepares the suite options as handed to the decorator to be able to operate on them fearlessly inside the @suite function.

    Parameters

    Returns PreparedSuiteOptions

    The validated and prepared options for @suite.

parseTestOptions

  • Validates and prepares the test options as handed to the decorator to be able to operate on them fearlessly inside the @test function.

    Type parameters

    • Params

    Parameters

    • Optional options: TestOptionsInput<Params>

      The options as provided by the user.

    Returns PreparedTestOptions<Params>

    The validated and prepared options for @test.

suite

  • Decorate a class with @suite or @suite("name of the suite") or @suite({ ... })to automatically run the@test-decorated methods inside adescribe` call. This automatically creates an instance for the decorated class.

    Parameters

    • Optional options: SuiteOptionsInput

      Can be provided or left out, so the decorator can be called with @suite() or like @suite. The name of the suite or a configuration object. @see SuiteOptions

    Returns ClassDecorator

    The decorated class.

  • Decorate a class with @suite or @suite("name of the suite") or @suite({ ... })to automatically run the@test-decorated methods inside adescribe` call. This automatically creates an instance for the decorated class.

    Type parameters

    Parameters

    • Optional Ctor: T

    Returns T

    The decorated class.

test

  • test<Params>(target: Object, property: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor
  • test<Params>(options?: TestOptionsInput<Params>): TestDecorator
  • Decorate a method with @test or @test("name of the test") or @test({ ... })to automatically have it run as a test inside anit` call.

    Type parameters

    • Params

    Parameters

    • target: Object
    • property: string | symbol
    • descriptor: PropertyDescriptor

    Returns PropertyDescriptor

    The decorated method.

  • Decorate a method with @test or @test("name of the test") or @test({ ... })to automatically have it run as a test inside anit` call.

    Type parameters

    • Params

    Parameters

    • Optional options: TestOptionsInput<Params>

      Can be provided or left out, so the decorator can be called with @test() or like @test. The name of the test or a configuration object. @see TestOptions

    Returns TestDecorator

    The decorated method.

Generated using TypeDoc