fix(platform-browser): support customEqualityTesters when overriding Jasmine toEqual
This commit is contained in:
parent
696af79dc7
commit
f580ffab4f
|
@ -114,10 +114,11 @@ export const expect: (actual: any) => NgMatchers = <any>_global.expect;
|
|||
_global.beforeEach(function() {
|
||||
jasmine.addMatchers({
|
||||
// Custom handler for Map as Jasmine does not support it yet
|
||||
toEqual: function(util) {
|
||||
toEqual: function(
|
||||
util: jasmine.MatchersUtil, customEqualityTesters: jasmine.CustomEqualityTester[]) {
|
||||
return {
|
||||
compare: function(actual: any, expected: any) {
|
||||
return {pass: util.equals(actual, expected, [compareMap])};
|
||||
return {pass: util.equals(actual, expected, [compareMap, ...customEqualityTesters])};
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue