Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Suite<T>

A suite represents one ply requests file (.ply.yaml), one ply case file (.ply.ts), or one flow file (.ply.flow);

Suites cannot be nested.

TODO: separate RequestSuite and CaseSuite (like FlowSuite) instead of conditional logic in this class.

Type parameters

Hierarchy

  • Suite

Index

Constructors

  • new Suite<T>(name: string, type: TestType, path: string, runtime: Runtime, logger: Logger, start?: number, end: number, className?: string, outFile?: string): Suite<T>
  • Type parameters

    Parameters

    • name: string

      suite name

    • type: TestType

      request|case|flow

    • path: string

      relative path from tests location (forward slashes)

    • runtime: Runtime

      info

    • logger: Logger
    • start: number = 0

      zero-based start line

    • end: number

      zero-based end line

    • Optional className: string
    • Optional outFile: string

    Returns Suite<T>

Properties

callingFlowPath?: string
className?: string
emitter?: EventEmitter
end: number
logger: Logger
name: string
outFile?: string
path: string
runtime: Runtime
skip: boolean = false
start: number = 0
tests: Tests<T> = {}
type: TestType

Accessors

Methods

  • [iterator](): Generator<T, void, undefined>
  • add(test: T): void
  • all(): T[]
  • emitSuiteFinished(): void
  • emitSuiteStarted(): void
  • emitTest(test: T): void
  • get(name: string): undefined | T
  • logOutcome(test: Test, outcome: Outcome, runNum?: number, label?: string): void
  • run(name: string, values: object, runOptions?: RunOptions, runNum?: number, instNum?: number): Promise<Result>
  • run(names: string[], values: object, runOptions?: RunOptions, runNum?: number): Promise<Result[]>
  • run(values: object, runOptions?: RunOptions): Promise<Result[]>
  • Run one test, write actual result, and verify vs expected.

    Parameters

    • name: string
    • values: object
    • Optional runOptions: RunOptions
    • Optional runNum: number

      iterating

    • Optional instNum: number

      looping

    Returns Promise<Result>

    result indicating outcome

  • Run specified tests, write actual results, and verify vs expected.

    Parameters

    • names: string[]
    • values: object
    • Optional runOptions: RunOptions
    • Optional runNum: number

    Returns Promise<Result[]>

    result array indicating outcomes

  • Run all tests, write actual results, and verify vs expected.

    Parameters

    Returns Promise<Result[]>

    result array indicating outcomes TODO: support runOptions.values for requests and cases

  • runTests(tests: T[], values: object, runOptions?: RunOptions, runNum?: number, instNum?: number): Promise<Result[]>
  • Tests within a suite are always run sequentially.

    Parameters

    • tests: T[]
    • values: object
    • Optional runOptions: RunOptions
    • runNum: number = 0
    • instNum: number = 0

    Returns Promise<Result[]>

  • size(): number

Generated using TypeDoc