From cc8ae32503e1829d5ff8dd9c888ea4f6bee43c0f Mon Sep 17 00:00:00 2001 From: Vikram Subramanian Date: Wed, 4 Oct 2017 02:49:12 -0700 Subject: [PATCH] fix(platform-browser): support customEqualityTesters when overriding Jasmine toEqual --- packages/platform-browser/testing/src/matchers.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/platform-browser/testing/src/matchers.ts b/packages/platform-browser/testing/src/matchers.ts index f43fe4e051..5903cba429 100644 --- a/packages/platform-browser/testing/src/matchers.ts +++ b/packages/platform-browser/testing/src/matchers.ts @@ -114,10 +114,11 @@ export const expect: (actual: any) => NgMatchers = _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])}; } };