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

@@ -71,20 +71,9 @@ describe('Suite', function() {
suite.beforeAll(outerBefore);
suite.beforeAll(innerBefore);
function sameInstance(expected) {
return {
asymmetricMatch: function(actual) {
return actual === expected;
},
jasmineToString: function() {
return `<same instance as ${expected}>`;
}
};
}
expect(suite.beforeAllFns).toEqual([
{ fn: outerBefore.fn, type: 'beforeAll', suite: sameInstance(suite) },
{ fn: innerBefore.fn, type: 'beforeAll', suite: sameInstance(suite) }
{ fn: outerBefore.fn, type: 'beforeAll', suite: jasmine.exactly(suite) },
{ fn: innerBefore.fn, type: 'beforeAll', suite: jasmine.exactly(suite) }
]);
});