Tests a function with strict equality, by wrapping the function and checking its
parameters and return value through isEquals function. If some parameter
or 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 assertEqualsFunction or
validateEqualsFunction instead.
Tests a function with strict equality.
Tests a function with strict equality, by wrapping the function and checking its parameters and return value through isEquals function. If some parameter or 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 assertEqualsFunction or validateEqualsFunction instead.
On the other hand, if you want to allow any superfluous properties, utilize isFunction, assertFunction or validateFunction instead.