From 84dc6ae76b7a87f3d28f35a0148c060967b251e4 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Thu, 7 May 2015 17:18:42 -0700 Subject: [PATCH] fix(test_lib): spy funcs should match null arguments --- modules/angular2/src/test_lib/test_lib.dart | 2 +- modules/angular2/test/test_lib/test_lib_spec.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/angular2/src/test_lib/test_lib.dart b/modules/angular2/src/test_lib/test_lib.dart index 8785f079b5..68fd1bfa08 100644 --- a/modules/angular2/src/test_lib/test_lib.dart +++ b/modules/angular2/src/test_lib/test_lib.dart @@ -72,7 +72,7 @@ Expect expect(actual, [matcher]) { return expect; } -const _u = null; +const _u = const Object(); class Expect extends gns.Expect { Expect(actual) : super(actual); diff --git a/modules/angular2/test/test_lib/test_lib_spec.js b/modules/angular2/test/test_lib/test_lib_spec.js index 57dde062f6..069fa6cfd8 100644 --- a/modules/angular2/test/test_lib/test_lib_spec.js +++ b/modules/angular2/test/test_lib/test_lib_spec.js @@ -91,6 +91,11 @@ export function main() { expect(spyObj.spy("someFunc")).toHaveBeenCalledWith(3,4); }); + it("should match null arguments", () => { + spyObj.someFunc(null, "hello"); + expect(spyObj.spy("someFunc")).toHaveBeenCalledWith(null,"hello"); + }); + it("should match using deep equality", () => { spyObj.someComplexFunc([1]); expect(spyObj.spy("someComplexFunc")).toHaveBeenCalledWith([1]);