Added a jasmine.exactly asymmetric equality tester

This commit is contained in:
Steve Gravrock
2022-05-14 17:01:38 -07:00
parent c24b2f5a73
commit 0c87d47318
6 changed files with 93 additions and 13 deletions

View File

@@ -283,6 +283,18 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
return new j$.Empty();
};
/**
* Get an {@link AsymmetricEqualityTester}, usable in any {@link matchers|matcher}
* that passes if the actual value is the same as the sample as determined
* by the `===` operator.
* @name jasmine.exactly
* @function
* @param {Object} sample - The value to compare the actual to.
*/
j$.exactly = function(sample) {
return new j$.Exactly(sample);
};
/**
* Get an {@link AsymmetricEqualityTester}, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
* that will succeed if the actual value being compared is not empty.