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

@@ -0,0 +1,17 @@
getJasmineRequireObj().Exactly = function(j$) {
class Exactly {
constructor(expected) {
this.expected_ = expected;
}
asymmetricMatch(actual) {
return actual === this.expected_;
}
jasmineToString(pp) {
return `<jasmine.exactly(${pp(this.expected_)})>`;
}
}
return Exactly;
};