Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Assert

Hierarchy

  • Assert

Index

Methods

Static _equal

  • _equal(expected: any, actual: any): boolean
  • Parameters

    • expected: any
    • actual: any

    Returns boolean

Static defined

  • defined(obj: object, msg?: string): void
  • Asserts that an object isn't null or undefined.

    throw

    AssertError if object is null or undefined

    Parameters

    • obj: object
    • Optional msg: string

    Returns void

Static equal

  • Asserts that two objects are equal.

    throw

    AssertError if they are not

    Parameters

    • expected: object
    • actual: object
    • Optional msg: string

    Returns any

  • Asserts that two dates are equal.

    throw

    AssertError if they are not

    Parameters

    • expected: Date
    • actual: Date
    • Optional msg: string

    Returns any

  • Asserts that two simple arrays are equal.

    throw

    AssertError if they are not

    Parameters

    Returns any

  • Asserts that two simple jsons are equal.

    throw

    AssertError if they are not

    Parameters

    Returns any

  • Asserts that two primitive types are equal.

    throw

    AssertError if they are not

    Parameters

    Returns any

Static equalError

  • Asserts that a function has error.

    throw

    AssertError if not equal

    Parameters

    Returns void

Static error

  • error(fn: Fallback<any>, msg?: string): void
  • Asserts that a function has error.

    throw

    AssertError if no error

    Parameters

    • fn: Fallback<any>
    • Optional msg: string

    Returns void

Static fail

  • fail(msg?: string): void
  • Fails a test with the given message.

    Parameters

    • Optional msg: string

    Returns void

Static failEqual

  • failEqual(expected: any, actual: any, msg?: string): void
  • Parameters

    • expected: any
    • actual: any
    • Optional msg: string

    Returns void

Static failNotEqual

  • failNotEqual(expected: any, actual: any, msg?: string): void
  • Parameters

    • expected: any
    • actual: any
    • Optional msg: string

    Returns void

Static failNotSameType

  • failNotSameType(expected: any, actual: any, msg?: string): void
  • Parameters

    • expected: any
    • actual: any
    • Optional msg: string

    Returns void

Static false

  • false(condition: boolean, msg?: string): void
  • Asserts that a condition is false.

    throw

    AssertError if condition is true

    Parameters

    • condition: boolean
    • Optional msg: string

    Returns void

Static notDefined

  • notDefined(obj: object, msg?: string): void
  • Asserts that an object is null or undefined.

    throw

    AssertError if object is not null or undefined

    Parameters

    • obj: object
    • Optional msg: string

    Returns void

Static notEqual

  • Asserts that two objects are not equal.

    throw

    AssertError if they are equal

    Parameters

    • expected: Date
    • actual: Date
    • Optional msg: string

    Returns any

  • Asserts that two simple arrays are not equal.

    throw

    AssertError if they are equal

    Parameters

    Returns any

  • Asserts that two simple jsons are not equal.

    throw

    AssertError if they are equal

    Parameters

    Returns any

  • Asserts that two primitive types are not equal.

    throw

    AssertError if they are equal

    Parameters

    Returns any

Static notSameType

  • notSameType(expected: any, actual: any, msg?: string): void
  • Asserts that two objects do not refer to the same type.

    throw

    AssertError if they are same type

    Parameters

    • expected: any
    • actual: any
    • Optional msg: string

    Returns void

Static sameType

  • sameType(expected: any, actual: any, msg?: string): void
  • Asserts that two objects refer to the same type.

    throw

    AssertError if they are not same type

    Parameters

    • expected: any
    • actual: any
    • Optional msg: string

    Returns void

Static true

  • true(condition: boolean, msg?: string): void
  • Asserts that a condition is true.

    throw

    AssertError if condition is false

    Parameters

    • condition: boolean
    • Optional msg: string

    Returns void