Options
All
  • Public
  • Public/Protected
  • All
Menu

Siesta project for isomorphic code.

Hierarchy

  • Project<this>
    • Project

Index

Constructors

constructor

  • new Project(...input: any[]): Project
  • Parameters

    • Rest ...input: any[]

    Returns Project

Properties

planItemT

The type of the argument for the plan method.

testDescriptor

testDescriptor: Partial<TestDescriptor> = undefined

The top-level TestDescriptor instance from which the descriptors of all tests in the suite will "inherit".

For example if the top-level descriptor contains certain value for the defaultTimeout config, then all tests will use that value, unless they explicitly override it.

testDescriptorClass

testDescriptorClass: typeof TestDescriptor = TestDescriptor

The constructor of TestDescriptor class or its subclass, to use in this project.

title

title: string = ''

The human readable title for the whole test suite. Will be included in the output, when starting the test suite.

Methods

initialize

  • initialize(props?: Partial<Project>): void
  • Parameters

    • Optional props: Partial<Project>

    Returns void

plan

  • Project plan is a set of tests to be launched. It is organized as "tree" data structure. The "parent" nodes of this tree usually corresponds to file system directories, and "leaf" nodes - to test files.

    This method adds a test descriptor to the project's plan. The descriptor is represented with the value of ProjectPlanItemDescriptor type.

    See also TestDescriptor.url for details on specifying the test file url.

    For example:

    project.plan(
    {
    // relative to project file
    url : 'some_directory',

    items : [
    // relative to `some_directory`
    { url : 'test_1.t.js' }
    // or just:
    'test_2.t.js',
    ]
    }
    )

    Parameters

    Returns void

Static maybeNew

  • maybeNew<T>(props?: InstanceType<T> | Partial<InstanceType<T>>): InstanceType<T>
  • This is a type-safe static constructor method, accepting a single argument. If that argument is already an instance of this class - it is returned right away, otherwise the new constructor is used for instantiation.

    Type parameters

    Parameters

    • Optional props: InstanceType<T> | Partial<InstanceType<T>>

    Returns InstanceType<T>

Static new

  • new<T>(props?: Partial<InstanceType<T>>): InstanceType<T>
  • This is a type-safe static constructor method, accepting a single argument, with the object, corresponding to the class properties. It will generate a compilation error, if unknown property is provided.

    For example:

    class MyClass extends Base {
    prop : string
    }

    const instance : MyClass = MyClass.new({ prop : 'prop', wrong : 11 })

    will produce:

    TS2345: Argument of type '{ prop: string; wrong: number; }' is not assignable to parameter of type 'Partial<MyClass>'.
    Object literal may only specify known properties, and 'wrong' does not exist in type 'Partial<MyClass>'

    The only thing this constructor does is create an instance and call the initialize method on it, forwarding the first argument. The customization of instance is supposed to be performed in that method.

    Type parameters

    Parameters

    • Optional props: Partial<InstanceType<T>>

    Returns InstanceType<T>

Generated using TypeDoc