Tests a function, by wrapping the function and checking its return value through
is function. If the return value does not match the expected type, it
returns null. Otherwise there's no type error, it returns the result of the
function.
By the way, if you want is not just testing type checking, but also finding
detailed type error reason(s), then use assertReturn or
validateReturn instead.
Tests return value.
Tests a function, by wrapping the function and checking its return value through is function. If the return value does not match the expected type, it returns
null
. Otherwise there's no type error, it returns the result of the function.By the way, if you want is not just testing type checking, but also finding detailed type error reason(s), then use assertReturn or validateReturn instead.
On the other hand, if you don't want to allow any superfluous properties, utilize equalsReturn, assertEqualsReturn or validateEqualsReturn instead.