fix(test_lib): spy funcs should match null arguments
This commit is contained in:
parent
05219a54cd
commit
84dc6ae76b
|
@ -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);
|
||||
|
|
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue