Options
All
  • Public
  • Public/Protected
  • All
Menu

Class JasmineAsyncEnv

Hierarchy

  • JasmineAsyncEnv

Index

Constructors

constructor

  • class
    name

    JasmineAsyncEnv

    description

    Environment class that links a number tests in a sequence with the wrap() method.

    Parameters

    • Optional linkedEnv: JasmineAsyncEnv

      Optional. Linked JasmineAsyncEnv to base the original this one on.

    Returns JasmineAsyncEnv

Properties

currentBody

currentBody: any = undefined

Property to hold the current data response from the server. Utility methods on this class act upon this object.

memberof!

JasmineAsyncEnv#

done

done: () => void = undefined

Should be called by the callback passed to wrap() to complete a test case. By default all tests that use wrap() are setup async so need to call this method

memberof!

JasmineAsyncEnv#

type

{function}

Type declaration

    • (): void
    • Returns void

id

id: number

Optional linkedEnv

linkedEnv: JasmineAsyncEnv

Optional. Linked JasmineAsyncEnv to base the original this one on.

Accessors

failed

  • get failed(): boolean
  • Indicates if any of the tests using this environment have failed. The wrap() method will not execute its callback on any further tests if this is true

    memberof!

    JasmineAsyncEnv#

    type

    {boolean}

    Returns boolean

Methods

checkProp

  • checkProp(propertyName: string): any
  • Utility method, used to check if a property exists on this.currentBody. Property identifier propertyName is passed using string values that can contain dots and array accessors. This means we can "try" access properties that would otherwise cause runtime errors without a lot of if statements.

    memberof

    JasmineAsyncEnv

    Parameters

    • propertyName: string

      The identifier for the source property on this.currentBody

    Returns any

    The value from this.currentBody[propertyName] if found

checkPropDoesntExist

  • checkPropDoesntExist(propertyName: string): any
  • Makes sure the supplied property doesn't exist on the currentBody

    memberof

    JasmineAsyncEnv

    Parameters

    • propertyName: string

    Returns any

    Returns the value found on currentBody using the property name

checkProps

  • checkProps(...properties: Array<string>): void
  • Utility method, used to check if an array of properties exist on this.currentBody

    see

    JasmineAsyncEnv#checkProp

    memberof

    JasmineAsyncEnv

    Parameters

    • Rest ...properties: Array<string>

      List of properties to check

    Returns void

expectProp

  • expectProp(propertyName: string, expected: any, useExplicitEquality?: boolean): any
  • Utility method to check for a string based property on this.currentBody. Will throw a descriptive expect().toBe() error if not found or not equal

    Parameters

    • propertyName: string

      The identifier for the property to match against on this.currentBody

    • expected: any

      The expected value to check against

    • Default value useExplicitEquality: boolean = false

      Weather to check using a != vs !==

    Returns any

getIsolate

  • getIsolate<T>(propertyName: string): T
  • Type parameters

    • T

    Parameters

    • propertyName: string

    Returns T

isolateEnvProperties

  • isolateEnvProperties<T>(propertyName: string): T
  • Utility method to move all non built in properties on the env into an isolated object with a name

    Type parameters

    • T

    Parameters

    • propertyName: string

    Returns T

setFailed

  • setFailed(): void
  • Returns void

setFailedGlobally

  • setFailedGlobally(): void
  • Returns void

setProp

  • setProp(destinationName: string, sourceName: string): any
  • Utility method, used to set a property from this.currentBody onto this object. Property identifiers for source and destination are passed using string values that can contain dots and array accessors. This means we can "try" access properties that would otherwise cause runtime errors without a lot of if statements. If the sourceName is not found on this.currentBody no property is set

    memberof

    JasmineAsyncEnv

    Parameters

    • destinationName: string

      The identifier for the destination property on this object

    • sourceName: string

      The identifier for the source property on this.currentBody

    Returns any

    The value from this.currentBody[sourceName] if found

wrap

  • Wrapper for a test method. The cb will only be executed if the all the previous tests have passed.

    memberof

    JasmineAsyncEnv

    Parameters

    Returns (done: any) => void

    A function to pass to the jasmine it() method.

      • (done: any): void
      • Parameters

        • done: any

        Returns void

Generated using TypeDoc