AssertAPI

interface AssertAPI : NodeAPI

Node API: Assert

Functions

Link copied to clipboard
abstract fun assert(value: Any?, message: String? = null)
Link copied to clipboard
abstract fun deepEqual(actual: Any?, expected: Any?, message: String? = null)
Link copied to clipboard
abstract fun deepStrictEqual(actual: Any?, expected: Any?, message: String? = null)
Link copied to clipboard
abstract fun doesNotMatch(string: String, regexp: Regex, message: String? = null)
abstract fun doesNotMatch(string: String, regexp: Value, message: String? = null)
Link copied to clipboard
abstract fun doesNotReject(asyncFn: Any, error: Any? = null, message: String? = null)
Link copied to clipboard
abstract fun doesNotThrow(fn: Any, error: Any? = null, message: String? = null)
abstract fun doesNotThrow(error: Any? = null, message: String? = null, fn: () -> Unit)
Link copied to clipboard
abstract fun equal(actual: Any?, expected: Any?, message: String? = null)
Link copied to clipboard
abstract fun fail(message: String? = null)
abstract fun fail(actual: Any? = null, expected: Any? = null, message: String? = null, operator: String? = null, stackStartFn: Any? = null)
Link copied to clipboard
abstract fun ifError(value: Any? = null)
Link copied to clipboard
abstract fun match(string: String, regexp: Regex, message: String? = null)
abstract fun match(string: String, regexp: Value, message: String? = null)
Link copied to clipboard
abstract fun notDeepEqual(actual: Any?, expected: Any?, message: String? = null)
Link copied to clipboard
abstract fun notDeepStrictEqual(actual: Any?, expected: Any?, message: String? = null)
Link copied to clipboard
abstract fun notEqual(actual: Any?, expected: Any?, message: String? = null)
Link copied to clipboard
abstract fun notOk(value: Any?, message: Any? = null)

Tests if value is falsy. It is equivalent to assert.equal(!!value, false, message).

Link copied to clipboard
abstract fun ok(vararg values: Any?)

Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message).

Link copied to clipboard
abstract fun rejects(asyncFn: Any, error: Any? = null, message: String? = null)
Link copied to clipboard
abstract fun strict(actual: Any?, expected: Any?, message: String? = null)
Link copied to clipboard
abstract fun throws(fn: Any, error: Any? = null, message: String? = null)
abstract fun throws(error: Any? = null, message: String? = null, fn: () -> Unit)