The goog.testing.asserts Namespace

.ArrayLike

@typedef
{Array|NodeList|Arguments|{length: number}}

.EQUALITY_PREDICATE_CANT_PROCESS {?string}

The return value of the equality predicate passed to findDifferences below, in cases where the predicate can't test the input variables for equality.

.EQUALITY_PREDICATE_VARS_ARE_EQUAL {?string}

The return value of the equality predicate passed to findDifferences below, in cases where the input vriables are equal.

.callWithoutLogging(fn)

Runs a function in an environment where test failures are not logged. This is useful for testing test code, where failures can be a normal part of a test.

fn {function() : void}
Function to run without logging failures.

.findDifferences(expected, actual, opt_equalityPredicate)

Determines if two items of any type match, and formulates an error message if not.

expected {*}
Expected argument to match.
actual {*}
Argument as a result of performing the test.
opt_equalityPredicate {(function(string, *, *): ?string)=}
An optional function that can be used to check equality of variables. It accepts 3 arguments: type-of-variables, var1, var2 (in that order) and returns an error message if the variables are not equal, goog.testing.asserts.EQUALITY_PREDICATE_VARS_ARE_EQUAL if the variables are equal, or goog.testing.asserts.EQUALITY_PREDICATE_CANT_PROCESS if the predicate couldn't check the input variables. The function will be called only if the types of var1 and var2 are identical.
returns {?string}
Null on success, error message on failure.