-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a custom Jasmine equality tester instead of replacing the default…
… toEqual.
- Loading branch information
Showing
3 changed files
with
30 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/*global define*/ | ||
define(function() { | ||
"use strict"; | ||
|
||
return function(a, b) { | ||
// if either a or b have an equals method, call it. | ||
if (a !== null && typeof a !== 'undefined' && typeof a.equals === 'function') { | ||
return a.equals(b); | ||
} | ||
|
||
if (b !== null && typeof b !== 'undefined' && typeof b.equals === 'function') { | ||
return b.equals(a); | ||
} | ||
|
||
// fall back to default equality checks. | ||
return undefined; | ||
}; | ||
}); |