Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Assert

Hierarchy

  • Assert

Index

Methods

Static equalJson

  • equalJson(input: any, expectation: any, msg?: string): void
  • Tests if the JSON representation of two objects is equal (we don't need the exact reference but only an equal)

    author

    sholzer 160511 (I wanted an Junit equivalent of assertEquals())

    Parameters

    • input: any

      :any an object

    • expectation: any

      :any the object input is expected to be equal

    • Default value msg: string = ""

      string failure message

    Returns void

    void. Calls fail() if JSON.stringify(input) != JSON.stringify(expectation)

Static notEqualJson

  • notEqualJson(input: any, expectation: any): void
  • Tests if the JSON representation of two objects is NOT equal (we don't need the exact reference but only an equal)

    author

    sholzer 160511 (I wanted an Junit equivalent of assertEquals())

    Parameters

    • input: any

      :any an object

    • expectation: any

      :any the object input is expected NOT to be equal

    Returns void

    void. Calls fail() if JSON.stringify(input) == JSON.stringify(expectation)