Skip to content

Commit

Permalink
fix(platform-browser): support customEqualityTesters when overriding …
Browse files Browse the repository at this point in the history
…Jasmine toEqual
  • Loading branch information
vikerman authored and alxhub committed Oct 4, 2017
1 parent 95f3b1d commit cc8ae32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/platform-browser/testing/src/matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])};
}
};

Expand Down

0 comments on commit cc8ae32

Please sign in to comment.