Options
All
  • Public
  • Public/Protected
  • All
Menu

Siesta project for Node.js code.

Hierarchy

  • ProjectNodejs<this>
    • ProjectNodejs

Index

Constructors

constructor

  • Parameters

    • Rest ...input: any[]

    Returns ProjectNodejs

Properties

planItemT

The type of the argument for the plan method.

testDescriptor

testDescriptor: Partial<TestDescriptor> & Partial<TestDescriptorNodejs> = 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 TestDescriptorNodejs = TestDescriptorNodejs

title

title: string = ''

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

Methods

excludeDir

  • excludeDir(dir: string): void
  • This method excludes all *.t.m?js test files in the dir directory from the project plan, recursively. The dir path is resolved relative to the project file.

    Parameters

    • dir: string

    Returns void

excludeFile

  • excludeFile(file: string): void
  • This method excludes a specific file from the project plan. The file path is resolved relative to the project file.

    Parameters

    • file: string

    Returns void

excludeGlob

  • excludeGlob(globPattern: string): void
  • This method excludes all files, matching the globPattern from the project plan. The glob matching happens in the project file directory.

    Parameters

    • globPattern: string

    Returns void

includeDir

  • An alias for planDir

    Parameters

    Returns void

includeFile

  • An alias for planFile

    Parameters

    Returns void

includeGlob

  • includeGlob(globPattern: string, desc?: Partial<TestDescriptor>): void
  • An alias for planGlob

    Parameters

    Returns void

initialize

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

    • Optional props: Partial<Project>

    Returns void

  • This method applies its 1st argument (if any) to the current instance using Object.assign().

    Supposed to be overridden in the subclasses to customize the instance creation process.

    Type parameters

    Parameters

    • Optional props: Partial<T>

    Returns void

  • Parameters

    • Optional props: Partial<ProjectTerminal>

    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

planDir

  • This method adds all *.t.m?js test files in the dir directory into the project plan, recursively. The dir path is resolved relative to the project file.

    The test descriptor, passed to this method will be assigned to the directory entry. This means any configuration properties in it will be "inherited" by the individual test files. Test files may still define some configs explicitly, overwriting the "inherited" values.

    See also planFile, planGlob

    Parameters

    Returns void

planFile

  • This method adds a specific test file into the project plan. The file path is resolved relative to the project file. The intermediate entries for the directories, containing the file, will be created as well.

    The test descriptor, passed to this method will be assigned directly to the test file entry. This means any configuration properties in it will overwrite corresponding properties from the parent entries.

    See also planDir, planGlob

    Parameters

    Returns void

planGlob

  • This method adds all files, matching the globPattern into the project plan. The glob matching happens in the project file directory.

    The test descriptor, passed to this method will be assigned directly to each matching test file entry. This means any configuration properties in it will overwrite ones from the parent plan entries.

    See also planFile, planDir

    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