Docs (4.0.0)
Assertions

class NegatedAssertion

Represents a value ready to be asserted, using inverse logic.

class NegatedAssertion<T>
extends Assertion<T>

Instance Members

Inherited Members

  • value readonlyThe value being asserted.
  • name readonlyThe name of the assertion, used in error messages.
  • not readonlyEvaluates to a new negated assertion, where all methods mean the opposite of those on the current instance.
  • asArray()Returns a new assertion for the return value of Array.from(...) on the current value.
  • asBoolean()Returns a new assertion for the boolean representation of the current value.
  • asString()Returns a new assertion for the string representation of the current value.
  • asNumber()Returns a new assertion for the number representation of the current value.
  • asJSONString(replacer?, space?)Returns a new assertion for the JSON representation of the current value.
  • toBeTruthy()Evaluates asBoolean().toBe(true).
  • toBeFalsy()Evaluates asBoolean().toBe(false).
  • toBeUndefined()Evaluates toBe(undefined).
  • toBeDefined()Evaluates toBeUndefined().
  • toBeNull()Evaluates toBe(null).