Packages

object Assert extends Object with Assert

Assert Singleton

Annotations
@native() @JSImport("assert", JSImport.Namespace)
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Assert
  2. Assert
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(expression: Any, message: String = js.native): Unit

    An alias of assert.ok() .

    An alias of assert.ok() .

    expression

    the expression to evaluate

    Definition Classes
    Assert
    Example:
    1. assert(value[, message])

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. def deepStrictEqual(actual: Any, expected: Any, message: String = js.native): Unit

    Generally identical to assert.deepEqual() with two exceptions.

    Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the strict equality operator ( === ). Second, object comparisons include a strict equality check of their prototypes.

    Definition Classes
    Assert
    Example:
    1. assert.deepStrictEqual(actual, expected[, message])

  8. def doesNotReject(asyncFn: |[Function, Promise[_]], error: |[RegExp, Function] = js.native, message: String = js.native): Unit
    Definition Classes
    Assert
  9. def doesNotThrow(block: Function, error: |[RegExp, Function] = js.native, message: String = js.native): Unit

    Asserts that the function block does not throw an error.

    Asserts that the function block does not throw an error. See assert.throws() for more details. When assert.doesNotThrow() is called, it will immediately call the block function. If an error is thrown and it is the same type as that specified by the error parameter, then an AssertionError is thrown. If the error is of a different type, or if the error parameter is undefined, the error is propagated back to the caller.

    Definition Classes
    Assert
    Example:
    1. assert.doesNotThrow(block[, error][, message])

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def fail(message: scala.scalajs.js.Error): Unit

    Definition Classes
    Assert
    See also

    https://nodejs.org/api/assert.html#assert_assert_fail_message

  13. def fail(message: String): Unit

    Definition Classes
    Assert
    See also

    https://nodejs.org/api/assert.html#assert_assert_fail_message

  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def ifError(value: Any): Unit

    Throws value if value is truthy.

    Throws value if value is truthy. This is useful when testing the error argument in callbacks.

    Definition Classes
    Assert
    Example:
    1. assert.ifError(value)

  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def notDeepStrictEqual(actual: Any, expected: Any, message: String = js.native): Unit

    Tests for deep strict inequality.

    Tests for deep strict inequality. Opposite of assert.deepStrictEqual().

    Definition Classes
    Assert
    Example:
    1. assert.notDeepStrictEqual(actual, expected[, message])

  22. def notStrictEqual(actual: Any, expected: Any, message: String = js.native): Unit

    Tests strict inequality as determined by the strict not equal operator ( !== ).

    Tests strict inequality as determined by the strict not equal operator ( !== ).

    Definition Classes
    Assert
    Example:
    1. assert.notStrictEqual(actual, expected[, message])

  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. def ok(value: Any, message: String = js.native): Unit

    Tests if value is truthy.

    Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message). If value is not truthy, an AssertionError is thrown with a message property set equal to the value of the message parameter. If the message parameter is undefined, a default error message is assigned.

    Definition Classes
    Assert
  26. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  27. def rejects(asyncFn: |[Function, Promise[_]], error: |[|[|[RegExp, Function], Object], Error] = js.native, message: String = js.native): Unit
    Definition Classes
    Assert
  28. val strict: Assert
  29. def strictEqual(actual: Any, expected: Any, message: String = js.native): Unit

    Tests strict equality as determined by the strict equality operator ( === ).

    Tests strict equality as determined by the strict equality operator ( === ).

    Definition Classes
    Assert
    Example:
    1. assert.strictEqual(actual, expected[, message])

  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def throws(block: Function, error: |[|[|[RegExp, Function], Object], Error], message: String = js.native): Unit

    If the values are not strictly equal, an AssertionError is thrown with a message property set equal to the value of the message parameter.

    If the values are not strictly equal, an AssertionError is thrown with a message property set equal to the value of the message parameter. If the message parameter is undefined, a default error message is assigned.

    Definition Classes
    Assert
    Example:
    1. assert.throws(block[, error][, message])

  32. def toLocaleString(): String
    Definition Classes
    Object
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. def valueOf(): Any
    Definition Classes
    Object
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def fail(actual: Any, expected: Any, message: String, operator: String): Unit
    Definition Classes
    Assert
    Annotations
    @deprecated
    Deprecated

    (Since version Node.js v10.0.0) Use assert.fail([message]) or other assert functions instead.

  2. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Assert

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped