In Jasmine 2.x at least, factory functions for each registered matcher can be found on the jasmine.matchers
global object.
To make use of the functionality behind toEqual
you could write
var toEqual = jasmine.matchers.toEqual();
var result = toEqual.compare('foo', 'bar');
and in this case value of result
here would be;
{
pass: false
}
because "foo"
does not equal "bar"
.